Created
May 31, 2013 02:32
-
-
Save lscott3/5682642 to your computer and use it in GitHub Desktop.
Rails 4 rc1 CanCan work around for strong params
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
# Rails 4 CanCan work around for strong params | |
before_filter do | |
resource = controller_name.singularize.to_sym | |
method = "#{resource}_params" | |
params[resource] &&= send(method) if respond_to?(method, true) | |
end | |
# Can't remember where I found this. Probably in the cancan github issue list. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment