开发者

Ruby on Rails: nested forms. One for bulk actions, the inner for Searching

开发者 https://www.devze.com 2023-01-07 08:16 出处:网络
I have in outer form_tag so that I can have bulk actions. but then I have an inner form_for for searchlogic.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号