Hi,
I've got a form with create and preview buttons - both point to create action, but if create button was pressed, user is redirected to show action, if preview was pressed user is redirected to edit action.
After redirecting to edit action I'd like to execute some javascript code, but only if user gets there using preview button. Is there some smart way to do it or should I simply pass additional parameter (item/ 1/edit?preview=true or something like this) and check for it in the view?
Thanks