Rails 3 + Ajax: how to access my local form builder instance

人走茶凉 提交于 2019-12-02 23:51:18

Can you use fields_for in your partial, and pass the @object to it? That way you don't need to pass a form builder?

partial:

<%= fields_for object do |f| %>
  f.text_field :field_name
<% end %>


$('#info').html("<%= escape_javascript(render 'my_second_fields_partial', object: @object) %>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!