Question for you all is it possible to use an action in an if
statement? I am using the same form for edit and new and I have a
cancel button on the page.
This cancel button is built with an if statement that looks right now
to see if a parameter exists to define where to go back to if the
user cancel. The problem occurs when the user submits the form and
there are missing fields by validation. The form is redrawn but my
parameter is now gone so it assumes that I was editing on the cancel
as opposed to going back to my list page. When the user clicks on the
button they get an error because there is no id for my object to show
as it does not exist.
basically can you do something like this:
<% if :action == ‘create’ %>
go back to the list
<% else %>
go to show something
<% end %>
and if you can what is the correct syntax as that does not work
(already tried it)
thanks again for all your help
Just trying to clean up my last few bugs/issues before the release of
this app to beta at the beginning of the week.