Created
August 10, 2011 16:54
-
-
Save kelsin/1137396 to your computer and use it in GitHub Desktop.
CanCan rules in engines and main apps
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
# This is your main app/models/ability.rb file in your app | |
class Ability < Namespace::Ability | |
def initialize(user) | |
super | |
# Main app CanCan rules | |
end | |
end |
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
# This is in your engine under app/models/namespace/ability.rb | |
module Namespace | |
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
# Engine CanCan rules | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment