jQuery + Ajax + Haml. js.erb files not firing

前端 未结 3 1798
一整个雨季
一整个雨季 2020-12-11 09:15

After reading up on a few experiences, I feel this issue might need to be brought up again. Coding in Rails3, I\'m trying to implement some smooth Ajax effects when a user

3条回答
  •  没有蜡笔的小新
    2020-12-11 09:54

    When my layout was coded in Haml (application.haml), AJAX wouldn't fire and the work-around code kelly.dunn mentioned didn't work.

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

    The easiest fix was to convert the application layout to .html.erb format.

提交回复
热议问题