-
-
Save samuelkadolph/991066 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InlineFormsController < ApplicationController | |
def self.cancan_enabled? | |
return @cancan_enabled if defined?(@cancan_enabled) | |
@cancan_enabled = begin | |
::Ability && true | |
rescue NameError | |
false | |
end | |
end | |
def cancan_enabled? | |
self.class.cancan_enabled? | |
end | |
helper_method :cancan_enabled? | |
load_and_authorize_resource if cancan_enabled? | |
include InlineFormsHelper | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment