Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试过了 <%= render :template =>'resources/new', :format => "js" %>,但没有任何反应。
<%= render :template =>'resources/new', :format => "js" %>
编辑:我也不知道如何将参数发送到 .js 模板。
通过这样做解决:
render :template => 'resources/new.js', :locals => {:link_id => "register_similar"}
在接收的 js.erb 文件中:
var link_id = '<%= link_id %>'