Sha256: e40e6d29f3188501a806ce25cf9358bcf00f11e04504f0a406d6fe322aec14ac

Contents?: true

Size: 1.93 KB

Versions: 11

Compression:

Stored size: 1.93 KB

Contents

EffectiveDatatables.setup do |config|
  # Authorization Method
  #
  # This method is called by all controller actions with the appropriate action and resource
  # If it raises an exception or returns false, an Effective::AccessDenied Error will be raised
  #
  # Use via Proc:
  # Proc.new { |controller, action, resource| authorize!(action, resource) }       # CanCan
  # Proc.new { |controller, action, resource| can?(action, resource) }             # CanCan with skip_authorization_check
  # Proc.new { |controller, action, resource| authorize "#{action}?", resource }   # Pundit
  # Proc.new { |controller, action, resource| current_user.is?(:admin) }           # Custom logic
  #
  # Use via Boolean:
  # config.authorization_method = true  # Always authorized
  # config.authorization_method = false # Always unauthorized
  #
  # Use via Method (probably in your application_controller.rb):
  # config.authorization_method = :my_authorization_method
  # def my_authorization_method(resource, action)
  #   true
  # end
  config.authorization_method = Proc.new { |controller, action, resource| authorize!(action, resource) }

  # Default number of entries shown per page
  # Valid options are: 5, 10, 25, 50, 100, 250, 500, :all
  config.default_length = 25

  # Default class used on the <table> tag
  config.html_class = 'table table-bordered table-striped'

  # When using the actions_column DSL method, apply the following behavior
  # Valid values for each action are:
  # true - display this action if authorized?(:show, Post)
  # false - do not display this action
  # :authorize - display this action if authorized?(:show, Post<3>)  (every instance is checked)
  #
  # You can override these defaults on a per-table basis
  # by calling `actions_column(show: false, edit: true, destroy: :authorize)`
  config.actions_column = {
    show: true,
    edit: true,
    destroy: true,
  }

  # Log search/sort information to the console
  config.debug = true

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
effective_datatables-3.4.2 config/effective_datatables.rb
effective_datatables-3.4.1 config/effective_datatables.rb
effective_datatables-3.4.0 config/effective_datatables.rb
effective_datatables-3.3.14 config/effective_datatables.rb
effective_datatables-3.3.13 config/effective_datatables.rb
effective_datatables-3.3.12 config/effective_datatables.rb
effective_datatables-3.3.11 config/effective_datatables.rb
effective_datatables-3.3.10 config/effective_datatables.rb
effective_datatables-3.3.9 config/effective_datatables.rb
effective_datatables-3.3.8 config/effective_datatables.rb
effective_datatables-3.3.7 config/effective_datatables.rb