Class: Administrate::Field::Url

Inherits:
Base
  • Object
show all
Defined in:
lib/administrate/field/url.rb

Instance Attribute Summary

Attributes inherited from Base

#attribute, #data, #options, #page, #resource

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

associative?, eager_load?, field_type, html_class, #html_class, #html_controller, #initialize, #name, permitted_attribute, #read_value, #required?, #to_partial_path, with_options

Constructor Details

This class inherits a constructor from Administrate::Field::Base

Class Method Details

.searchable?Boolean

Returns:



6
7
8
# File 'lib/administrate/field/url.rb', line 6

def self.searchable?
  true
end

Instance Method Details

#html_optionsObject



14
15
16
# File 'lib/administrate/field/url.rb', line 14

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

#truncateObject



10
11
12
# File 'lib/administrate/field/url.rb', line 10

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