If I have a User table and a form that displays all my users with a
Rank. I want to be able to rank my users and then hit ‘update’ and all
users will be parsed by my action into User model obects and then
persisted with their new rank to the DB.
Using “scaffold :user” in my controller works wonders for Single
instance CRUD functionality of my User class, but can it be done with a
So basically I have this
@user_list = User.find_all()
In my views I’m doing.
<% form_tag :action => ‘update_users’ do %>
<% for user in @user_list %>
<%-- display the user information here as a form -->
<% end %>
<% end %>
<%= submit_tag “Update Users” %>
I would love to have the submit button (and associated action call)
update ALL the users automatically without ME having to create a complex
parser to break all the :params being passed into User objects and save
them 1 by 1. (Through a loop of course).
I hope my description is clear… it’s crystal in my head.