class SimpleAttribute::Attributes::File

Public Instance Methods

attribute_name() click to toggle source
# File lib/simple_attribute/attributes/file.rb, line 4
def attribute_name
  'file'
end
render_attribute() click to toggle source
# File lib/simple_attribute/attributes/file.rb, line 8
def render_attribute
  file  = value.to_s.split('/').last.split('.').first
  label = file.try(label_method)
  title = file.try(title_method)

  link_to label, value.to_s, html_options.merge(title: title)
end