Resource A and B are nested. In the form for C, I need to populate a
dropdown of B:s depending on the value of A.
Trying to be RESTful, my approach is to have an onchange-handler on the
A dropdown which calls the index action of B and redraws the B dropdown
using RJS and a partial.
My concern is that because the RJS and partial should generate a
select-helper for editing C, the code in the "B domain" (controller,
RJS, partial) needs to be C-aware which feels ugly...
Does anybody have an alternative design which makes this cleaner
somehow?
Another (perhaps silly) question. If I use the form builder object in
the partial for B, it seems hard to reuse it from RJS because I don''t
have a form builder object there. Or should I skip the form builder for
the B dropdown and use the instance variable instead? (Similar to how
scaffolding in earlier version of Rails did it)
Wow, that''s a long and somewhat strange post. I''m impressed
that you
made it to the end! ;-)
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---