Sha256: f9f9087b2c6c42720bf5c2b870dd25df456b732e7c4934b896c8f6b08dabcbe7

Contents?: true

Size: 629 Bytes

Versions: 17

Compression:

Stored size: 629 Bytes

Contents

class RegistrationsController < ApplicationController
  skip_before_action :authenticate, only: :create

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

    if @<%= singular_table_name %>.save
      render json: @<%= singular_table_name %>, status: :created
    else
      render json: @<%= singular_table_name %>.errors, status: :unprocessable_entity
    end
  end

  def destroy
    Current.<%= singular_table_name %>.destroy
  end

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

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
authentication-zero-2.8.0 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.7.0 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.6.0 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.5.1 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.5.0 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.4.0 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.3.6 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.2.10 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.2.9 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.2.8 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.2.7 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.2.6 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.2.5 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.2.4 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.2.3 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.2.2 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.2.1 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt