mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-15 21:07:52 -05:00
17 lines
493 B
Ruby
17 lines
493 B
Ruby
class ApplicationController < ActionController::Base
|
|
protect_from_forgery
|
|
|
|
# tweak CanCan defaults because we don't have a "current_user" method
|
|
# this means that we use current_user in specs but current_member everywhere
|
|
# else in the code.
|
|
def current_ability
|
|
@current_ability ||= Ability.new(current_member)
|
|
end
|
|
|
|
# CanCan error handling
|
|
rescue_from CanCan::AccessDenied do |exception|
|
|
redirect_to request.referer || root_url, :alert => exception.message
|
|
end
|
|
|
|
end
|