Skip to content

Instantly share code, notes, and snippets.

@jameslafa
Created July 9, 2013 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameslafa/5960890 to your computer and use it in GitHub Desktop.
Save jameslafa/5960890 to your computer and use it in GitHub Desktop.
ActiveAdmin : Make model compliant with ActiveModel and StrongParameters Thanks to @daxter (twitter @seanlinsley) for his help : https://github.com/gregbell/active_admin/pull/2326
# To support StrongParameters (require in Rails 4.0), add this (change names of
# fields of course) to your /app/admin/<model>.rb
# This example is for AdminUser model
ActiveAdmin.register AdminUser do
controller do
def permitted_params
params.permit admin_user: [:email, :password, :password_confirmation]
end
end
end
# Rails 4.0 just went out and right now to make ActiveAdmin works, you need
# to add this in your Gemfile
gem 'devise', github: 'plataformatec/devise'
gem 'responders', github: 'plataformatec/responders'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'ransack', github: 'ernie/ransack', branch: 'rails-4'
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'
gem 'formtastic', github: 'justinfrench/formtastic'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment