Topic: Submit form to itself.

I have a page with a form that has 4 input fields. I am able to store the 4 values to the session by creating a 2nd page to display the session data.
What I want to do is submit the 1st page back to itelf in order to display the session data on this same page.

Re: Submit form to itself.

You can redirect back to the form after it is submitted. Let's say you have a new page with a form that gets submitted to the create action. Just redirect back to the new action where the form is displayed.

def create
  Foo.create(params[:foo])
  #...
  flash[:notice] = 'Successfully created foo.'
  redirect_to :action => 'new'
end

does that answer your question?

Railscasts - Free Ruby on Rails Screencasts

Re: Submit form to itself.

Thank you, that's perfect.

Last edited by rx7haze (2007-01-08 19:35:30)