Created
July 9, 2013 11:16
-
-
Save rodrigobaron/5956591 to your computer and use it in GitHub Desktop.
solve strong_parameters issue for cancan + rails 4 .. source: https://github.com/ryanb/cancan/issues/835
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
#Add this code in ApplicationController | |
before_filter do | |
resource = controller_name.singularize.to_sym | |
method = "#{resource}_params" | |
params[resource] &&= send(method) if respond_to?(method, true) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment