At the moment I have controller that deal with error messages and
acknowledgements. I redirect to this with a message parameter and the
of event (which determines if the icon is a smilie, a bomb, an
mark or a question mark) and the url to go to on the OK button.
You are probably familiar with this kind of thing on the GUI of your
However it seems heavy handed to send a complete new page in many
conditions. For example, access control errors could probably be better
served by a pop-up that when ack’d leaves the user where he was.
I realise that this will require identifying what parts of the code need
pop-up modal rather than a sequential modal.
My question is this: Is there a simple way to “render” a pop-up modal?
Am I better off with
@item = Item.find( … )
else # Modal page
redirect_to ( :controller = ‘oops’,
:action => ‘accesscontrol’,
:class => ‘Item’, :object => @item,
:message => “Cannot edit”,
:return_url => ???
or am I better trying to set up some kind of exception handler?
Opportunities multiply as they are seized.