Devise: How to create a new user being already logged in?

后端 未结 8 2115
独厮守ぢ
独厮守ぢ 2021-02-02 16:22

I\'m going to create a multi user app, so, I will have a admin user that will have permission to create new ones.

I\'ve created the UsersControllerbut when

8条回答
  •  情深已故
    2021-02-02 16:43

    In a controller method can't you just go:

    def create_user
        @user = User.new(:email => params[:email], :password => params[:password])
        @user.save
        ...
    end
    

提交回复
热议问题