Sha256: f198ad03a8894a186bde770ea9bfc8bb3c17bcd04700a9a70725d7ba47800074

Contents?: true

Size: 494 Bytes

Versions: 52

Compression:

Stored size: 494 Bytes

Contents

module Para
  module AttributeField
    class FileField < AttributeField::Base
      include ActionView::Helpers::UrlHelper

      register :file, self

      field_option :wrapper, :wrapper_name

      def value_for(instance)
        if instance.send(:"#{ name }?")
          url = instance.send(name).url
          link_to(url, url)
        end
      end

      def excerptable_value?
        false
      end

      def wrapper_name
        :horizontal_file_input
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
para-0.12.4 lib/para/attribute_field/file.rb
para-0.12.3 lib/para/attribute_field/file.rb
para-0.12.2 lib/para/attribute_field/file.rb
para-0.12.1 lib/para/attribute_field/file.rb
para-0.12.0 lib/para/attribute_field/file.rb
para-0.11.4 lib/para/attribute_field/file.rb
para-0.11.3 lib/para/attribute_field/file.rb
para-0.11.2 lib/para/attribute_field/file.rb
para-0.11.1 lib/para/attribute_field/file.rb
para-0.11.0 lib/para/attribute_field/file.rb
para-0.10.0 lib/para/attribute_field/file.rb
para-0.9.4 lib/para/attribute_field/file.rb
para-0.9.3.3 lib/para/attribute_field/file.rb
para-0.9.3.2 lib/para/attribute_field/file.rb
para-0.9.3.1 lib/para/attribute_field/file.rb
para-0.9.2 lib/para/attribute_field/file.rb
para-0.9.0 lib/para/attribute_field/file.rb
para-0.8.15 lib/para/attribute_field/file.rb
para-0.8.14 lib/para/attribute_field/file.rb
para-0.8.13 lib/para/attribute_field/file.rb