2009/9/29 RVince <[email protected]>:
>
> Whoops! You're right!
>
> <% form_for :lead,  :url => { :controller => 'channels', :action =>
> "lead" }, :html => {:name => 'leadform'} do |f| %>
> <%= f.label :origin %><br />
> <%= f.select( "associate_id", Associate.find(:all,  :order =>
> 'associates.lastname ASC',  :conditions => ['deleted=0']).collect {|p|
> [ p.to_s, p.id ]}, {:include_blank => ''}) %>
>
> However, if I add in :
>
> <% @lead.associate_id = @Up.associate_id %>
>
> Nothing happens ? Additionally, I try making this statement in te
> method of the controller which renders the partial that this view code
> is in, again, nothing happens (i.e. it does not select the associate
> in the select box)

I use :associate_id in f.select but I don't think that should make any
difference.
Have you verified just before the f.select that @lead.associate_id is
a value from the set?  Display the id on the form and check the html
(View, Page Source or similar in browser) to check that the id is in
the selection set.
Try it without the include_blank option (clutching at straws here).

Colin

--~--~---------~--~----~------------~-------~--~----~
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