我想从rails 2转到5,但Rails 5不支持link_to_remote
:
<%= link_to_remote "Add",
:url=>{:action=>'fee_submission',:batch=>@batch,s_id=>@stud_id}
在控制器中:
def fee_submission
# ..some code..
render :update do |page|
page.replace_html "fee", :partial => "fees"
end
查看_fees.html.erb:
<html>
code
</html>
如何在Rails 5中实现上述代码?
答案 0 :(得分:1)
可能你可以在link_to here is link for more detail
的参数选项中使用remote:true<%= link_to "Add", fee_submission_controller_path, remote: true %>