Ruby on Rails: nested forms. One for bulk actions, the inner for Searching
I have in outer form_tag so that I can have bulk actions.
but then I have an inner form_for for searchlogic.
only the outer form works.
The inner one doesn't show up in the HTML in inspector. (chrome)
Relavent code:
<% form_tag :controller => :objects, :action => :bulk_action do %>
<% form_for @search, :html=>{:id=>"filter"} do |f| %>
<% end %>
<%= observe_form :filter,
:frequency=>0.5,
:update=>'objects',
:url=>{:action=>'filter',
:only_path=>false},
:before => "startLoad('objects');",
:complete => "stopLoad('objects');" %>
<div id="proposals">
<%= render(:partial=>"objects") %>
<开发者_Go百科/div>
<% end %>
You shouldn't have one form tag inside another one. That's incorrect in HTML and not allowed.
Use fields_for for the nested for.
精彩评论