Skip to content

Instantly share code, notes, and snippets.

@nfedyashev
Created August 17, 2012 09:20
Show Gist options
  • Save nfedyashev/3377341 to your computer and use it in GitHub Desktop.
Save nfedyashev/3377341 to your computer and use it in GitHub Desktop.
Make strong_parameters work nice with rails_admin
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