Module: R404Helper

Defined in:
app/helpers/r404_helper.rb

Instance Method Summary collapse

Instance Method Details

#r404(code = 404, exception = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/helpers/r404_helper.rb', line 3

def r404 code = 404, exception = nil
    # status = code.is_a?(Integer) ? code : nil
    case code
    when 403, :access_denied
        raise R404::AccessDenied.new(exception)
    when 404, :not_found
        raise R404::NotFound.new(exception)
    end
end