Sha256: 123babf7aea5181d79fed826206381307968728b65839d2bfe8b04f086b96536
Contents?: true
Size: 1 KB
Versions: 1
Compression:
Stored size: 1 KB
Contents
class SignupController < ApplicationController <% if oauth? %>include AuthsHelper <% end %> # Create a new Signup form model (found in app/forms/signup.rb) def new @signup = Signup.new end def create remember = params[:remember_me] == "1" @signup = Signup.new(signup_params) if @signup.save login(@signup.user, remember) respond_to do |format| format.json { head :no_content } format.html { redirect_to root_path } end else respond_to do |format| format.json { render json: { status: 'error', errors: @signup.errors }.to_json, status: 422 } format.html { render :new } end end end protected def signup @signup end def signup_params params.require(:signup).permit( :email, <% if username? %>:username, <% end %>:password, :password_confirmation, :first_name, :last_name, :bio, :website, :phone_number, :time_zone) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
authkit-0.7.0 | lib/generators/authkit/templates/app/controllers/signup_controller.rb |