The formtastic gem might be able to help you.
https://github.com/justinfrench/formtastic
It makes writing forms a lot easier and has helpers for writing groups
of buttons and stuff. Here''s an example from the readme on github...
f.input :authors, :as => :check_boxes, :collection => User.find(:all,
:order => "last_name ASC")
f.input :authors, :as => :check_boxes, :collection =>
current_user.company.users.active
f.input :authors, :as => :check_boxes, :collection => [@justin, @kate]
f.input :authors, :as => :check_boxes, :collection =>
["Justin",
"Kate", "Amelia", "Gus", "Meg"]
f.input :author, :as => :select, :collection =>
Author.find(:all)
f.input :author, :as => :select, :collection => { @justin.name
=> @justin.id, @kate.name => @kate.id }
f.input :author, :as => :select, :collection =>
["Justin",
"Kate", "Amelia", "Gus", "Meg"]
f.input :author, :as => :radio, :collection => User.find(:all)
f.input :author, :as => :radio, :collection => [@justin, @kate]
f.input :author, :as => :radio, :collection => { @justin.name
=> @justin.id, @kate.name => @kate.id }
f.input :author, :as => :radio, :collection =>
["Justin",
"Kate", "Amelia", "Gus", "Meg"]
f.input :admin, :as => :radio, :collection => ["Yes!",
"No"]
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.