Rails Ajax: .js.erb rendered as text, not JS

前端 未结 4 1107
情话喂你
情话喂你 2020-12-09 23:05

I\'m having a trouble with rails3 to render Javascript (If this is relevant, I use JQuery and it works fine since it\'s used in numerous other parts of the application) inst

4条回答
  •  盖世英雄少女心
    2020-12-09 23:18

    If you are on rails,

    Simple fix: Add data-type="script" to the form. Source: https://github.com/rails/jquery-ujs/wiki/Unobtrusive-scripting-support-for-jQuery

提交回复
热议问题