Sha256: 103d128fb677d71ca79f635ed18602f9fc503942f7fe1c10d1bf2c7b379f2bc5

Contents?: true

Size: 633 Bytes

Versions: 12

Compression:

Stored size: 633 Bytes

Contents

class 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.require(:<%= singular_table_name %>).permit(:email)
    end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
authentication-zero-2.7.0 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt
authentication-zero-2.6.0 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt
authentication-zero-2.5.1 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt
authentication-zero-2.5.0 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt
authentication-zero-2.4.0 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt
authentication-zero-2.3.6 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt
authentication-zero-2.3.5 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt
authentication-zero-2.3.4 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt
authentication-zero-2.3.3 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt
authentication-zero-2.3.2 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt
authentication-zero-2.3.1 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt
authentication-zero-2.3.0 lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt