1
votes

I'm using active admin on rails 4, I white-listed the parameters for admin users in the controller using:

ActiveAdmin.register AdminUser do
 controller do
  def permitted_params
   params.permit(:admin_user => [:email, :password, :password_confirmation])
  end
 end
end

but when I try to add a new user, I get the error "cannot be blank" on the email and password fields. The logs read the following:

Unpermitted parameters: utf8, authenticity_token, commit
Unpermitted parameters: utf8, authenticity_token, admin_user, commit

Is there something I'm missing?

2
If you are here because of the utf8, authenticity_token, commit then I would suggest this solution is not related to this issue github.com/gregbell/active_admin/issues/2595 - Jay Killeen

2 Answers

1
votes

I was also facing the same issue.

Changing

params.permit(:admin_user => [:email, :password, :password_confirmation])

to

params.permit(:user => [:email, :password, :password_confirmation])

solved the issue. devise in active admin creates model with name user and in active admin user model, its mentioned as admin_user.

0
votes

In my case it was happenning because i had a validation for an associated record on that model. Disabling that validation fixes it, will need to check how to disable validations for active admin only.