On Jun 26, 2007, at 1:01 AM, luke wrote:
> unless user_can_view_group
> raise "User does not have permission to view
group''"
> end
>
> Which happily prevents users from viewing groups. But the error page
> is rather ugly, and I''d like to pass the raise string to a view
which
> can give them a nicer looking error page. Is this possible?
Instead of raising an exception you can handle that with a regular view:
unless user_can_view_group
@msg = "User does not have permission to view group"
render :action => ''generic_message''
end
-- fxn
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---