Sha256: 23e9bb9cf03387694edf22b1c6a024259b5741d8011f5b0ccc08bbddefcd58d1

Contents?: true

Size: 638 Bytes

Versions: 2

Compression:

Stored size: 638 Bytes

Contents

class RegistrationsController < ApplicationController
  skip_before_action :authenticate

  def new
    @<%= singular_table_name %> = <%= class_name %>.new
  end

  def create
    @<%= singular_table_name %> = <%= class_name %>.new(<%= "#{singular_table_name}_params" %>)

    if @<%= singular_table_name %>.save
      redirect_to sign_in_path, notice: "Welcome! You have signed up successfully"
    else
      render :new, status: :unprocessable_entity
    end
  end

  private
    def <%= "#{singular_table_name}_params" %>
      params.require(:<%= singular_table_name %>).permit(:email, :password, :password_confirmation)
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
authentication-zero-2.1.1 lib/generators/authentication/templates/controllers/html/registrations_controller.rb.tt
authentication-zero-2.1.0 lib/generators/authentication/templates/controllers/html/registrations_controller.rb.tt