foodsoft/app/controllers/errors_controller.rb

23 lines
395 B
Ruby
Raw Permalink Normal View History

2015-06-06 20:20:07 +02:00
class ErrorsController < ApplicationController
include Gaffe::Errors
skip_before_action :authenticate
2015-06-06 20:20:07 +02:00
layout :current_layout
def show
render "errors/#{@rescue_response}", formats: :html, status: @status_code
2015-06-06 20:20:07 +02:00
end
private
def current_layout
current_user ? 'application' : 'login'
end
def login_layout?
current_user.nil?
end
helper_method :login_layout?
end