Created
May 25, 2011 14:07
-
-
Save workmad3/991045 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 instance_variables.include?(:@cancan_enabled) | |
::Ability | |
@cancan_enabled = true | |
rescue NameError | |
@cancan_enabled = false | |
end | |
def cancan_enabled? | |
self.class.cancan_enabled? | |
end | |
helper :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