Forum: Ruby on Rails updating multiple records in a single form.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Vikas G. (Guest)
on 2009-02-25 13:43
Hello All,

I am new to ruby, so please excuse me.

problem is --------

I have a model named "Album"
I want to update all records from "albums" table in a single form and
single button "Update".

my code for view ---

<% form_for :album, :url => { :action => "update", :id => } do
|f| %>
<%= f.error_messages %>

<td><%= f.text_field :title, :value => "#{album.title}"%></td>
<td><%= f.text_field :year, :value => "#{album.year}" %></td>
<td><%= f.text_field :language, :value => "#{album.language}" %></td>
<td><%= f.text_field :display_css, :value => "#{album.display_css}"
<td><%= submit_tag 'Update' %></td>

<% end %>

this shows only one record. But i want all records display in form and
single Update button.

How I use for loop?
How I do this?
Please help me.
This topic is locked and can not be replied to.