Forum: Ruby on Rails re-selecting a select list on create

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E6520b0addebfd58b83d7f2dc8d91b01?d=identicon&s=25 Steven Ross (Guest)
on 2005-12-19 19:54
(Received via mailing list)
I have a select list tht is built from a "collection_select" and I want
to
reselect the value the user submitted if any part of the form errors.

could someone point me in the right direction for doing this?

my select looks like this

collection_select(:company, :id, @companies, :id, :name)

I tried setting the variable @company to param[:company]  but that didnt
work.

thanks

--
Steven Ross
web application & interface developer
http://www.zerium.com
[phone] 404-488-4364
E6520b0addebfd58b83d7f2dc8d91b01?d=identicon&s=25 Steven Ross (Guest)
on 2005-12-19 19:57
(Received via mailing list)
nevermind I should have set the variable like this:

@company = @person.company

On 12/19/05, Steven Ross <nowhiding@gmail.com> wrote:
> I tried setting the variable @company to param[:company]  but that didnt
> work.
>
> thanks
>
> --
> Steven Ross
> web application & interface developer
> http://www.zerium.com
> [phone] 404-488-4364




--
Steven Ross
web application & interface developer
http://www.zerium.com
[phone] 404-488-4364
This topic is locked and can not be replied to.