Forum: Italian Ruby user group Helper Select

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.
278cbf1cc439901141f0de3796f03ebf?d=identicon&s=25 Dboz Dboz (dbozz)
on 2009-06-08 12:40
Utilizzando l'helper select in questo modo

select("post", "category", Post::CATEGORIES, {:include_blank => true})

ottengo:

  <select name="post[category]">
    <option></option>
    <option>joke</option>
    <option>poem</option>
  </select>

Come devo utilizzare lo stesso helper per ottenere

  <select name="post[category]">
    <option value=""></option>
    <option value="0">joke</option>
    <option value="1">poem</option>
  </select>
This topic is locked and can not be replied to.