how to add a new value to a dropdown list in Rails

Posted by LearnRails on Stack Overflow See other posts from Stack Overflow or by LearnRails
Published on 2010-04-12T02:28:06Z Indexed on 2010/04/12 2:33 UTC
Read the original article Hit count: 224

Filed under:

In my item table, I have a itemname column which is currently a dropdown list taking values from DB.

<%= select 'item','itemname' , Item.find(:all).collect{|c| [c.itemname]},{:include_blank => 'Select Name'} >

How can I add a new value to this dropdown list through the application. Is there a provision to directly add value to the list?

Thanks

© Stack Overflow or respective owner

Related posts about ruby-on-rails