Sha256: 69efa9d58a0dfcc7867d7aeb545f1c0850e27a10cfffc34e9100778593c95cbd

Contents?: true

Size: 675 Bytes

Versions: 1

Compression:

Stored size: 675 Bytes

Contents

# frozen_string_literal: true
require 'csv'

class <%= class_name %>Controller < ApplicationController
  include Pagy::Backend
  layout 'administrator'
  before_action :authenticate_administrator!, :set_default_locale
  authorize :user, through: :current_administrator

  private

  def namespace
    @namespace ||= Bo::Administrators
  end

  def set_default_locale
    I18n.default_locale = :fr
  end

  protected

  # Devise routing overwrite for multiples resources
  def after_sign_in_path_for(resource)
    send(:"#{resource.class.name.underscore.pluralize}_root_path")
  end

  def after_sign_out_path_for(resource)
    send(:"new_#{resource}_session_path")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tybo-0.4.1 lib/generators/bo_namespace/templates/admin_controller.rb