Sha256: 064ede52e76e4c6cf2a0c77962c4d945fe6ad14e3e6fc5ac18c4270d27dfb4dc

Contents?: true

Size: 606 Bytes

Versions: 7

Compression:

Stored size: 606 Bytes

Contents

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

  def edit
  end

  def update
    if @<%= singular_table_name %>.update(<%= "#{singular_table_name}_params" %>)
      redirect_to root_path, notice: "Your email has been changed"
    else
      render :edit, 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

7 entries across 7 versions & 1 rubygems

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