re-selecting a select list on create

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

re-selecting a select list on create

Steve Ross-5
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
_______________________________________________
Rails mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails
Reply | Threaded
Open this post in threaded view
|

Re: re-selecting a select list on create

Steve Ross-5
nevermind I should have set the variable like this:

@company = @person.company

On 12/19/05, Steven Ross <[hidden email]> wrote:
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
<a href="http://www.zerium.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.zerium.com
[phone] 404-488-4364



--
Steven Ross
web application & interface developer
http://www.zerium.com
[phone] 404-488-4364
_______________________________________________
Rails mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails