Use a nicer less error prone version of the select helper
authorShaun McDonald <shaun@shaunmcdonald.me.uk>
Wed, 27 May 2009 13:15:58 +0000 (13:15 +0000)
committerShaun McDonald <shaun@shaunmcdonald.me.uk>
Wed, 27 May 2009 13:15:58 +0000 (13:15 +0000)
app/views/diary_entry/edit.rhtml

index 6657d033a22da841b340f006271c8cfde094e5a9..615d4b69ba32732782d87c286c13ed7e5bf1ba04 100644 (file)
@@ -14,7 +14,7 @@
     </tr>
     <tr valign="top">
       <td class="fieldName">Language:</td>
-      <td><%= f.select :language, Language.find(:all).map {|l| [l.name, l.code]} %></td>
+      <td><%= f.collection_select :language, Language.find(:all), :code, :name %></td>
     </tr>
     <tr valign="top">
       <td class="fieldName">Location:</td>