Created
July 9, 2013 20:18
-
-
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
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
# 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 |
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
# 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