Skip to content

Manual Error Redirects #29

@dessery85

Description

@dessery85

Hi

First of all, thank you very much for your excellent Gem!! I appreciate that this is not really an issue with your gem but more of a use case but I am hoping you might be able to give me some advice, my app has some admin only pages on it so I want to throw a 403 error if a non admin user tries to access those pages. I have seen lots of people suggesting online to do the following:

render :file => File.join(Rails.root, 'public/403.html'), :action => 'show', :status => 403, :layout => false

This is obviously manually rendering a static file which then bypasses Gaff, is there any way throw an error myself that will be handled by Gaffe and routed to my proper error pages?

Many many thanks
David

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions