views:

12

answers:

0

i am trying to get a rails select form options helper to get a :selected value that is non-integer. actually i am using the object-id format from mongodb.

the html example:

<option value="4c613e3c8ee60a1c31000024">test</option>

rails select:

<%= select( "question", "#{number}", active_question.answers.collect{|x|[x.title, x.id] },{:include_blank => "please select", :selected => "4c613e3c8ee60a1c31000024"}, 
    { :class => "questionselect yellowbg"}

how can i make rails select the right option value (preselect)? using the content "test" is not an option, since i am using a multilinugal approach and the content is variable.

thanks for all input and help!