At the moment I have controller that deal with error messages and
acknowledgements. I redirect to this with a message parameter and the
type
of event (which determines if the icon is a smilie, a bomb, an
exclamation
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
operating system
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
a
pop-up modal rather than a sequential modal.
My question is this: Is there a simple way to ārenderā a pop-up modal?
Second question:
Am I better off with
@item = Item.find( ⦠)
if @item.access.edit?
ā¦
else # Modal page
redirect_to ( :controller = āoopsā,
:action => āaccesscontrolā,
:class => āItemā, :object => @item,
:message => āCannot editā,
:return_url => ???
)
end
or am I better trying to set up some kind of exception handler?
ā
Opportunities multiply as they are seized.
āSun Tzu