textis given, the default text "Are you sure?" will be used.
failureevents, it will be emitted regardless of the server response.
200HTTP status code.
500HTTP status codes.
idattribute, like so:
classattribute, like so:
:foo => 'bar'in the params.
:id => '42'to the route we have defined!
app/controllers/action_test_controller.rbto see what the endpoints do:
action_configsuccess message and will get re-rendered.
good job!message that was initially hidden and disappears again after 300ms.
failure_action_test_pathto see how we can notify the user if things go wrong!
localhost:3000/action_test/page1and see our first page, shown by the
This is Page 1text.
Click me!) and get transfered to the second page. There, we see the
This is Page 2text and, for 300ms, our
server says: good job!success message. Neat!
Click me!) on the second page, we get the failure message (
server says: something went wrong!) and get sent back to page 2, just as we wanted to.