List Info

Thread: Re: interesting question (possibly)




Re: interesting question (possibly)
user name
2007-06-28 08:35:57


On 6/28/07, surge < gerasesgmail.com">gerasesgmail.com> wrote:

> Do you mean that when your page is loaded the correct piece of equipment is
> not selected in your select box?

Yep. But it only happens when the page reloads after a validation
error.

&gt; <%= select(:equipment, :site_id, Site.list(session[:customer_id]),
> { :include_blank => 'true&#39;, :selected => equipment.site_id }) %>

I so hoped it would! Unfortunately, it didn't. Also, I don't see
":selected&quot; as a valid option that can be passed to "select()". At
least not in the API docs.

Thanks for the try anyway!

From the docs

http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#M000506

By default, post.person_id is the selected option. Specify :selected => value to use a different selection or :selected => nil to leave all options unselected



--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talkgooglegroups.com
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )