新しいアカウントを作成できる管理者がいます。新しいアカウントを作成するために、gem Authlogic を使用しています。管理者として、ログインせずに新しいユーザー用に新しいアカウントを作成したいと考えています (Authlogic での一般的なプロセスは、フォーム入力 -> フォーム送信 -> アカウントの作成 + 新しいユーザーのログイン) です。ログインせずに必要です。
新しいアカウントを作成するための標準コードは次のとおりです。
def create
@user = User.new(params[:user])
respond_to do |format|
if @user.save
format.html { redirect_to @user, notice: 'User was successfully created.' }
format.json { render json: @user, status: :created, location: @user }
else
format.html { render action: "new" }
format.json { render json: @user.errors, status: :unprocessable_entity }
end
end
end
ログインをスキップするには?
ありがとう