Sha256: b2c162df686f2811c0f8d8a1e41429e0fe2a65c78eee141f3bb883584ffaf7ab

Contents?: true

Size: 390 Bytes

Versions: 7

Compression:

Stored size: 390 Bytes

Contents

require_relative "base"

module Administrate
  module Field
    class Url < Field::Base
      def self.searchable?
        true
      end

      def truncate
        data.to_s[0...truncation_length]
      end

      def html_options
        @options[:html_options] || {}
      end

      private

      def truncation_length
        options.fetch(:truncate, 50)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
administrate-1.0.0.beta3 lib/administrate/field/url.rb
administrate-1.0.0.beta2 lib/administrate/field/url.rb
administrate-1.0.0.beta1 lib/administrate/field/url.rb
administrate-0.20.1 lib/administrate/field/url.rb
administrate-0.20.0 lib/administrate/field/url.rb
administrate-0.19.0 lib/administrate/field/url.rb
administrate-0.18.0 lib/administrate/field/url.rb