the field name: collection_select(:post, :author_id, Author.all, :id, :name_with_initial, :prompt => true) will generate:
<select name="post[author_id]"> <option value="">Please select</option> <option value="1" selected="selected">D. Heinemeier Hansson</option> <option value="2">D. Thomas</option> <option value="3">M. Clark</option> </select> look fella, for docs look at http://apidock.com/rails is awesome and much better see ya and any questions, please just ask :) Em 10/08/2011, às 21:52, 7stud -- escreveu: > The rails docs are so horrible on the collection_select method. They > need to show a *complete* form, and show two examples: one that calls > f.collection_select(), and another that calls collection_select(), and > explain the differences. > > Given this line: > > f.collection_select :topic, Topic.all, :id, :category > > What the !@#$!@#$ is :topic? > > -- > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

