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?
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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.