Sha256: e9e25e2436d0e5208aba86adec82a34d72dd66fb691baf740a272d30f553d410

Contents?: true

Size: 603 Bytes

Versions: 10

Compression:

Stored size: 603 Bytes

Contents

class Identity::EmailsController < ApplicationController
  before_action :require_sudo
  before_action :set_<%= singular_table_name %>

  def update
    if @<%= singular_table_name %>.update(<%= "#{singular_table_name}_params" %>)
      render json: @<%= singular_table_name %>
    else
      render json: @<%= singular_table_name %>.errors, status: :unprocessable_entity
    end
  end

  private
    def set_<%= singular_table_name %>
      @<%= singular_table_name %> = Current.<%= singular_table_name %>
    end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
authentication-zero-2.10.0 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt
authentication-zero-2.9.3 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt
authentication-zero-2.9.2 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt
authentication-zero-2.9.1 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt
authentication-zero-2.9.0 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt
authentication-zero-2.8.4 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt
authentication-zero-2.8.3 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt
authentication-zero-2.8.2 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt
authentication-zero-2.8.1 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt
authentication-zero-2.8.0 lib/generators/authentication/templates/controllers/api/identity/emails_controller.rb.tt