Skip to content

Instantly share code, notes, and snippets.

@rodrigobaron
Created July 9, 2013 11:16
Show Gist options
  • Save rodrigobaron/5956591 to your computer and use it in GitHub Desktop.
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
#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