views:

51

answers:

2

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") %>
           </div>
 <% end %>
+1  A: 

You shouldn't have one form tag inside another one. That's incorrect in HTML and not allowed.

Zheileman
any ideas for a solution, then?
DerNalia
@DerNalia Use two forms that are not nested.
Pointy
Thanks.. -_-...Is there really no way around it? because I need my bulk actions in the same area as the searching area... twould be terribly hackish to have two separate form and CSS them into the right position.
DerNalia
I think you must rewrite the logic of your bulk edition.Perhaps, you must extract the outer form and leave the inner search form alone.When you do a search and later click in the selected object for doing an action over it, you will need to pass that object's ID to the another form (input hidden), and submit it with javascript submit()Just one idea.
Zheileman
A: 

Use fields_for for the nested for.

Suman Mukherjee