<after-submit>

Used inside a form to specify where to redirect after successful submission. This works by inserting a hidden field called after_submit which is used by Hobo if present to perform a redirect after the form submission.

Usage

Use the stay-here attribute to remain on the current page:

<form>
  <after-submit stay-here/>
  ...
</form>

Use the uri option to specify a redirect location:

<form>
  <after-submit uri="/admin"/>
  ...
</form>

Use the go-back option to return to the page in session[:previous_uri]:

<form>
  <after-submit go-back/>
  ...
</form>

Note that session[:previous_uri] isn’t automatically populated. To automatically populate it, add to application_controller.rb:

after_filter HoboRapid::PreviousUriFilter

Show Source


Edit this page