[Rails] Re: Re: Drop-down menu from a belongs_to association
Leonel *.* wrote:
[...]
>
> I'm sorry, just to make sure I got it, then you mean is better to use
>
> <div class="field">
> <%= f.label :client_id %><br />
> <%= f.collection_select :client_id, @clients, :id, :name, :prompt =>
> "Select" %>
> </div>
>
> than...
>
> <div class="field">
> <%= f.label :service_id %><br />
> <%= collection_select "appointment", "client_id", @clients, "id",
> "name", {:prompt => "Select"} %>
> </div>
>
> right?
Yes. You've already specified the object once (when creating the
form_for scope) -- don't repeat yourself!
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home