Re: [Rails] help with session
On 21 April 2012 12:03, Paul Na <lists@ruby-forum.com> wrote:
> Hi all,
>
> I have a app with the /tests/new location which renders the add new
> form. This all works perfectly so when i fill the form in it goes
> straight into the db but i want the form to store the data in
> session[:whateverfield] i.e.
>
> session[:id], session[:title], session[:name], etc
>
> Then pass this the session values to display on a preview info page.
> Which then the user can edit the session. Once the form is ok then it
> can be submitting to the db.
>
> So i guess the form i have doesn't need to be changed due to the fields
> i need are there already but obviously when i press submit button it add
> the info to the db and not the session, is there something i have to
> change i.e. the form_for link etc.
Possibly you want separate controller actions, one that just saves it
in the session and one that saves it in the db. Either that or extend
the existing actions to do one or the other as appropriate.
Colin
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home