On Mar 19, 2:56 pm, Shandy Nantz <[email protected]>
wrote:
> I have this code:
>
> <%= select 'stuff', 'id', Stuff.find_by_sql( "SELECT stuffs.value,
> stuffs.id from stuffs WHERE account_id = " + @account.id.to_s + " ORDER
> BY stuffs.value ASC" ).collect{ |a| [a.value, a.id] }, {:include_blank
> => true, :selected => @user.stuff_profile.to_s } %>

I'm not sure what stuff_profile is, but the fact that you're
converting it, whatever it is, to a string means that it's guaranteed
not to be equal to any of those ids.

Fred

> The issue is is that the blank space is added but the value is not set
> as selected. I have this same code (only using a different table) and
> that code adds the blank space and selects the correct drop down item.
> When I view the html everything looks good - option has a value as the
> id and I am telling it to select using the id. As far as I can see this
> should work, but it doesn't. Any ideas of what I am doing wrong. Thanks,
>
> -S
> --
> Posted viahttp://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
-~----------~----~----~----~------~----~------~--~---

Reply via email to