How to render new.js.coffee.erb in app/views?

前端 未结 2 1826
失恋的感觉
失恋的感觉 2021-02-02 08:38

Using Rails 3.1 jquery_ujs, I have a link with :remote => true, and the controller new action responds with js and render new.js.erb which contains:

$(\'#post-fo         


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-02 09:09

    I had this same issue using Rails 3.1.0. Try renaming your file to just new.js.coffee. It should still render erb despite not having the extension on the filename.

    It's definitely confusing that view templates don't follow the same conventions as the asset pipeline.

提交回复
热议问题