2015-06-06 20:20:07 +02:00
|
|
|
class ErrorsController < ApplicationController
|
|
|
|
include Gaffe::Errors
|
|
|
|
|
|
|
|
skip_before_filter :authenticate
|
|
|
|
|
|
|
|
layout :current_layout
|
|
|
|
|
|
|
|
def show
|
|
|
|
render "errors/#{@rescue_response}", status: @status_code
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2017-09-23 10:17:33 +02:00
|
|
|
def select_foodcoop
|
|
|
|
foodcoop = params[:foodcoop]
|
|
|
|
if FoodsoftConfig.allowed_foodcoop? foodcoop
|
|
|
|
FoodsoftConfig.select_foodcoop foodcoop
|
|
|
|
else
|
|
|
|
FoodsoftConfig.select_default_foodcoop
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-06-06 20:20:07 +02:00
|
|
|
def current_layout
|
|
|
|
current_user ? 'application' : 'login'
|
|
|
|
end
|
|
|
|
|
|
|
|
def login_layout?
|
|
|
|
current_user.nil?
|
|
|
|
end
|
|
|
|
helper_method :login_layout?
|
|
|
|
end
|