Sha256: 87bd5b5ff87cdbaac145a9eb231fdda0cc2396e96a9047470dd0b0029a53a1e6

Contents?: true

Size: 546 Bytes

Versions: 31

Compression:

Stored size: 546 Bytes

Contents

class RegistrationsController < ApplicationController
  skip_before_action :authenticate

  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

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

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
authentication-zero-2.11.2 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.11.1 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.11.0 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.10.0 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.9.3 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.9.2 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.9.1 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.9.0 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.8.4 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.8.3 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.8.2 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.8.1 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.1.1 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.1.0 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-2.0.0 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-1.0.2 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-1.0.1 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-1.0.0 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-0.0.24 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-0.0.23 lib/generators/authentication/templates/app/controllers/api/registrations_controller.rb.tt