I have many “edit” actions in my project. If the url is like
http://localhost/project/3/edit and someone enters
http://localhost/project/3333333/edit the edit action will fails because
it cannot find a project with id of 3333333.
To combat this I am adding to every action like edit:
redirect_to :action => ‘index’
flash[‘errors’] = “That project cannot be edited.”
This works, however is there a way to do this globally or do I have to
entered this for every action that could error in this way? I understand
about using routes to narrow down what URL’s can be typed, but this does
not escape an error when a value entered is incorrect.
Incidentally, I looked at the Typo code and could not see any error
checking, not a rescue in sight. How do they do it in typo?