Skip to content

Instantly share code, notes, and snippets.

@lscott3
Created May 31, 2013 02:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lscott3/5682642 to your computer and use it in GitHub Desktop.
Save lscott3/5682642 to your computer and use it in GitHub Desktop.
Rails 4 rc1 CanCan work around for strong params
# 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