Sha256: 939f618d5ddfc371fce4c3607da7e592408ba8ebd17f466b5ef70cde2bf8165a

Contents?: true

Size: 583 Bytes

Versions: 6

Compression:

Stored size: 583 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.require(:<%= singular_table_name %>).permit(:email, :password, :password_confirmation)
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
authentication-zero-0.0.11 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-0.0.10 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-0.0.9 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-0.0.8 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-0.0.7 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt
authentication-zero-0.0.6 lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt