ruby on rails - Authlogic - how to make a registration and don't log in the new account? -
i have administration can create new accounts. creating new accounts using gem authlogic. admin, create new account new user without log in (the common process authlogic filling form -> sending form -> account created + new user logged in). need without log in.
here's standard code creating new account:
def create @user = user.new(params[:user]) respond_to |format| if @user.save format.html { redirect_to @user, notice: 'user 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
how skip log-in thing?
thanks
you can use save_without_session_maintenance
instead of save
save user without logging in.
def create @user = user.new(params[:user]) respond_to |format| if @user.save_without_session_maintenance format.html { redirect_to @user, notice: 'user 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
Comments
Post a Comment