I have an STI model where UtilityProvider is the parent class, and
there''s a sub-class for each specific utility provider.
When the user goes to choose a UtilityProvider, I want to present a
pull-down list of UtilityProvider.subclasses (or, more likely, a
filtered version of that), and when the user hits [submit] to create the
appropriate subclass.
To add a little spice to the question, I have a Premise model, and
premise has_many :utility_providers
and I''m using nested routes to represent the relationship:
resources :premises do
resources :utility_providers
end
So at the point in my code where I invite the user to create a new
UtilityProvider, I *do* have a @premise, but I don''t have a
@utility_provider.
I think this requires a fields_for rather than a form_for construct with
a collection_select within it, but I''m really stumped on how to
structure the form. What''s the Rails-y way to do this?
TIA.
- ff
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.