I have a select list with this code:
<% @products.each do |product| %> > <%= product.name%> <% end %>In this select list the user can see the product names. I think it is
possible to do that in one line. How can I do that?
I have a select list with this code:
<% @products.each do |product| %> > <%= product.name%> <% end %>In this select list the user can see the product names. I think it is
possible to do that in one line. How can I do that?
John S. writes:
In this select list the user can see the product names. I think it
is
possible to do that in one line. How can I do that?
I beleive the SELECT ActionView Helper is what you are looking for.
– Long
http://FATdrive.tv/wall/trakb/10-Long
http://FATdrive.tv/ - store, play, share
Le 25 Mar 2008 à 22:08, John S. a écrit :
something like collection_select :ticket, :product_id,
@products, :id, :name
should do the trick.
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs