Created
August 17, 2012 09:20
-
-
Save nfedyashev/3377341 to your computer and use it in GitHub Desktop.
Make strong_parameters work nice with rails_admin
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
class ApplicationController < ActionController::Base | |
before_filter :skip_strong_parameters, :if => :rails_admin_path? | |
def skip_strong_parameters | |
params.select { |key, value| params[key].kind_of?(ActionController::Parameters) }.map { |key, value| params[key].permit! } | |
end | |
privaate | |
def rails_admin_path? | |
controller_path =~ /rails_admin/ | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment