22 Jul 12:01
Re: form_for and select ( => f.select)
From: Luca Scaljery <rails-mailing-list@...>
Subject: Re: form_for and select ( => f.select)
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-22 10:01:02 GMT
Subject: Re: form_for and select ( => f.select)
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-22 10:01:02 GMT
Luca Scaljery wrote:
> Roy Pardee wrote:
>> What do you want the user to see in the drop-down? What do you want
>> stored in the xyz_id field of your @xyz object? I'm having a hard time
>> understanding the .collect call in there.
>>
>> Does this run without error?
>>
>> f.select("xyz_id", @my_arr, {:prompt => "opt1"})
>>
>> Cheers,
>>
>> -Roy
>
> if I do that I get the following error
>
> undefined method `xyz_id' for #<Xyz:0x4304cfc
The problem is solved.
The problem occured due to the first 2 parameters. For example, this
doesn't work
select("abc", "abc_id" .....)
but this does
select("abc", "def_id" .... )
so now it works for f.select too!
thnx a lot for the help!!
--
--
Posted via http://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 rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
RSS Feed