Can't create new user with ActiveAdmin

前端 未结 4 1828
南笙
南笙 2020-12-20 06:31

I just added active admin to my rails app and I\'m unable to create a new user. I am using the user model that active admin creates with a few added columns like first and

4条回答
  •  情书的邮戳
    2020-12-20 06:42

    Upvoting @Danpe's answer. "Password" is a required field. So you need to add it to permit_params and also ask for password in the form. Only then will it save the form correctly. Here is my permit params string that also fixes other issues with creating a ActiveAdmin user mentioned here : https://github.com/gregbell/active_admin/issues/2595

    controller do
        def permitted_params
          params.permit :utf8, :_method, :authenticity_token, :commit, :id,
                    model: [:attribute1, :attribute2, etc]
        end
    end
    

提交回复
热议问题