Seth Portman wrote in post #1117487:> I am following Railscasts #217 and I have been able to make everything
> work
> using html protocol the only issue is that I need it to use ajax
> protocol
> instead. My question and code is very similar to stackoverflow question
> Multistep
> forms in Rails using
>
AJAX<http://stackoverflow.com/questions/14228368/multistep-forms-in-rails-using-ajax>> .
> I understand how to setup ajax and make the form sumit remotely my
> question
> though is how do I pass over the forms variable i.e. "f" as in
"<%> form_for @post do |f|>" Any help is appreciated.
I think you''re probably making this too complicated. If you''re
using
JavaScript anyway then just have one page, with one form. Use JavaScript
(no AJAX required) to show and hide the fields for the various steps in
the process. Ryan mentioned, and recommended, this approach at the
beginning of the episode.
Since have have only a single page with a single form there''s nothing
to
pass around. The are no changes required in your controller or model
classes. As far as Rails is concerned it''s no different than a regular
form submission.
If your multi-step form is extremely complex then I might suggest
considering one of the single page app solutions such as Ember.js,
Backbone.js or Angular.js.
--
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 unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/17eb5cb030adee7550a3580b939b0ee3%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.