This project is archived and is in readonly mode.

#1348 ✓wontfix

Clarify options_from_collection_for_select example

Reported by revgum | November 8th, 2008 @ 07:08 PM | in 2.x

I'm not sure if I'm doing this correctly.. I'm using the diff from Github. Please bear with me, and let me know if I should submit this differently?

@@ -207,6 +207,11 @@ module ActionView 0

   # options_from_collection_for_select(@project.people, "id", "name")


   # <option value="#{}">#{}</option>



0 + # Example (call, result). When specifying +selected+ using an ID be sure to pass an Integer rather than a string: 0 + # options_from_collection_for_select(@project.people, "id", "name", some_id.to_i) 0 + #

#{} 0 + # #{} #assume some_id was a string value of this 0 + # 0
   # NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.


   def options_from_collection_for_select(collection, value_method, text_method, selected = nil)


     options = do |element|

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket