Sha256: c324b414492cf4eb6c3e4a3db6c02a66a19e9c86acad2190b7847ac2d30ba49d

Contents?: true

Size: 854 Bytes

Versions: 4

Compression:

Stored size: 854 Bytes

Contents

require 'active_support/configurable'

module MightyGrid
  # Configures global settings for MightyGrid
  #   MightyGrid.configure do |config|
  #     config.grid_name = 'g'
  #   end
  def self.configure(&block)
    yield @config ||= MightyGrid::Configuration.new
  end

  # Global settings for MightyGrid
  def self.config
    @config
  end

  class Configuration #:nodoc:
    include ActiveSupport::Configurable
    config_accessor :per_page
    config_accessor :order_direction
    config_accessor :grid_name
    config_accessor :header_tr_class
    config_accessor :table_class
    config_accessor :pagination_theme
  end

  configure do |config|
    config.per_page = 15
    config.order_direction = 'asc'
    config.grid_name = 'grid'
    config.table_class = ''
    config.header_tr_class = ''
    config.pagination_theme = 'mighty_grid'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mighty_grid-0.4.0 lib/mighty_grid/config.rb
mighty_grid-0.3.3 lib/mighty_grid/config.rb
mighty_grid-0.3.2 lib/mighty_grid/config.rb
mighty_grid-0.3.1 lib/mighty_grid/config.rb