Forum: Ruby updating multiple records for a single model in single form

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3832c46fac01379dfa5b14c60fac8b5c?d=identicon&s=25 Vikas Gholap (vikas)
on 2009-02-28 07:15
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 => album.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>
<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.
Thanks,
Viki
1bc63d01bd3fcccc36fb030a62039352?d=identicon&s=25 David Masover (Guest)
on 2009-02-28 10:36
(Received via mailing list)
Vikas Gholap wrote:
> Hello All,
>
> I am new to ruby, so please excuse me.
>
> problem is --------
>
> I have a model named "Album"
>

Ruby doesn't natively support "models" of any kind. You probably want to
ask this on the Rails list:

http://groups.google.com/group/rubyonrails-talk
This topic is locked and can not be replied to.