Andrew Edwards wrote:> Hi Neil,
>
> Did you ever get anywhere with this? I''ve got the same issue, in
my
> case a create action with multiple possible render options depending
> on the page. I''ve just posted a question about it and then found
your
> thread.
>
> At present I''ve just got to create actions (create and
checkout_create
> - it''s for addresses which can also be created during a checkout)
>
> Regards,
>
> Andrew
>
> On 6 Aug, 22:41, Neil Cauldwell
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
I''ve kept the separate controller actions for now - it just works.
Although, it''ll probably be cleaned-up at some point based on tips in
these posts;
http://www.spacevatican.org/2008/5/26/conditional-rjs-explained
http://gerhardlazu.com/blog/52/conditional-rjs
If you can perform RJS based on the presence of a DOM ID or class, you
can keep things in one RJS file. However, it can get messy either way.
If you stick with two controller actions, and you''re happy it works,
make a ''shared create'' method which contains the code which
actually
creates the address, that way you only have one piece of code for saving
the records to the database. That was the only part that really got to
me.
--
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
-~----------~----~----~----~------~----~------~--~---