Class: SignupController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- SignupController
- Defined in:
- lib/generators/authkit/templates/app/controllers/signup_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#new ⇒ Object
Create a new Signup form model (found in app/forms/signup.rb).
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/generators/authkit/templates/app/controllers/signup_controller.rb', line 9 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 |
#new ⇒ Object
Create a new Signup form model (found in app/forms/signup.rb)
5 6 7 |
# File 'lib/generators/authkit/templates/app/controllers/signup_controller.rb', line 5 def new @signup = Signup.new end |