This is a beginning Rails question. I have two models, Member and 
Organization, in a one-to-many association. (An Organization can have many 
Members.) The problem is I'm not sure how to design a view/controller that 
allows the user to associate an existing Member to an Organization. One way 
is to create a big HTML Select tag containing Member.all, and allow the 
user to pick the Member he wants to add. This is easy to do, but there 
could be hundreds or even thousands of Members, so it's not very scalable.

An alternative idea is to create a separate "ChooseMemberController" and 
pop up its view in a new browser window. The view would show a paginated 
list of all Members, which solves the scalability problem. But I don't know 
how to communicate the user's selection back to the original calling 
controller. Also, a pop-up window might not be the best user experience.

I've been searching for any tips on handling this situation. All I've found 
is this Rails 
Recipe<http://media.pragprog.com/titles/fr_arr/multiple_models_one_form.pdf>, 
which is very close to what I'm trying to do, but unfortunately it doesn't 
show how to pick an item from a potentially large table.

Can anyone point me to an example or give me some idea of how to implement 
this? Thanks!

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/HhEpl3CYXM4J.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en-US.

Reply via email to