So, i’m trying to follow along with this example. I’m trying to translate it to my own own project where I have a set of rows that are displayed based on the results of applying the search criteria in a first form. I’m trying now to put a second form around the results to provide the administrator with checkboxes to be able to edit several of the rows displayed at the same time. however, when i try to put a form around the results, the results disappear altogether.
Here’s the relevant piece of my controller:
def index
@search = Distribution.workflow.search(params[:traits_searchable_search])
respond_to do |f|
f.html {
@report = @search.paginate(:page => params[:page])
render :action => 'index'
}
f.csv do
send_data @report.to_csv, :type => "text/csv", :filename => "distribution_workflow_report.csv"
end
end
end
the view is nothing special. but i’m trying to wrap this tag (i’ve also tried removing the :method => :put piece and it’s worth noting that the path provided to the form_tag is the page that’s being displayed for now until i figure out how i’m going to get the routing to work):
<% form_tag admin_distributions_workflows_path, :method => :put do %>
around this table:
<table class="standard-grid">
<tr>
<th class="first"></th>
<th>ID</th>
<th>Customer</th>
<th>Customer Email</th>
<th>Resume URL</th>
<th>Partner</th>
<th>Partner Email</th>
<th>Status</th>
<th>Assigned To</th>
<th>Comments</th>
<th></th>
</tr>
<% @report.each do |row| %>
<tr>
<td><%= check_box_tag "row_ids[]", row.id %></td>
<td>
<%= row.owner.id %>
</td>
....
</td>
</tr>
<% end %>
</table>
<% end %>
Since Rails 3 you have to use
<%=format withform_forandform_tag