Rails update.js.erb not executing javascript

后端 未结 7 1886
[愿得一人]
[愿得一人] 2020-12-13 18:35

I am building a form in rails that will edit an existing question via ajax.

After the form is submitted and the question has been updated, the update method in the c

7条回答
  •  独厮守ぢ
    2020-12-13 19:19

    Do you work with haml, or html.erb? If the former, then this might be the solution:

    respond_to do |format|
      ...
      format.js {render layout: false}
    end
    

    I had the exact same problem, found this question early on, took another hour or so of Googling to find this question on StackOverflow that led me to it: jQuery + Ajax + Haml. js.erb files not firing

提交回复
热议问题