Sha256: 161332725c7a034eac7980216d59df39bffc126a2cefc6f61d5edb19a593dd2d

Contents?: true

Size: 624 Bytes

Versions: 7

Compression:

Stored size: 624 Bytes

Contents

require File.join %w(extend_it dsl)

module AdminIt
  class TilesContext < CollectionContext
    class << self
      dsl_accessor :header do |value|
        if value.nil?
          fields.empty? ? nil : fields.first.name
        else
          field = fields.find { |f| f.field_name == value }
          field.nil? ? header(nil) : field.field_name
        end
      end
    end

    def self.path
      AdminIt::Engine.routes
        .url_helpers.send("tiles_#{resource.plural}_path")
    end

    class << self
      protected

      def default_icon
        'th'
      end
    end

    class_attr_reader :header
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
admin_it-1.0.7 lib/admin_it/context/tiles_context.rb
admin_it-1.0.6 lib/admin_it/context/tiles_context.rb
admin_it-1.0.5 lib/admin_it/context/tiles_context.rb
admin_it-1.0.4 lib/admin_it/context/tiles_context.rb
admin_it-1.0.3 lib/admin_it/context/tiles_context.rb
admin_it-1.0.2 lib/admin_it/context/tiles_context.rb
admin_it-1.0.1 lib/admin_it/context/tiles_context.rb