I have a question regarding using sessions with REST.
I'm wondering if passing form data between controllers using sessions
is not recommended for Rails / REST?
I need to prepopulate a form, based on information from another form
(which doesn't have a model behind it).
You could think of this as a multi-step form where the first step
are not really good here unless I use AJAX to populate the second step
of the form...Even then a 'tab' interface is not desired (the user
should have no way of switching back and forth, or any idea that it's
a multi-step form from the interface side, the user should just fill
one form, which leads to a second, created based on data from the
My plan was to use a separate controller for the first step which
would pass parameters to the main controller to render the second step
in its new method, through via the rails session variable.
The first controller would render the first step via its 'new'
action. Upon posting, it would take the :params posted into the
'create' action and use it to place variables into the Rails session
variable. Then the same 'create' action would redirect the browser to
the second controller's 'new' action which would then pickup the
variables needed to construct the second, main, part of the form from
the Rails session variable.
Unfortunately it makes the 'new' method of the main controller
unfunctional without the Rails session being initialized by the first
controller's 'create' action (as it needs those extra parameters in
order to layout the second, main part of the form)
Is this a un-RESTful way to do things (passing extra data around via
sessions)? Should I instead pass a querystring to the 'new' method of
the main controller? Should I lump everything into the main
controller some how?