Class: AttachmentRenderer
- Inherits:
-
ResourceRenderer::AttributeRenderer::Base
- Object
- ResourceRenderer::AttributeRenderer::Base
- AttachmentRenderer
- Defined in:
- app/attribute_renderers/attachment_renderer.rb
Instance Attribute Summary
Attributes inherited from ResourceRenderer::AttributeRenderer::Base
Instance Method Summary collapse
Methods inherited from ResourceRenderer::AttributeRenderer::Base
Constructor Details
This class inherits a constructor from ResourceRenderer::AttributeRenderer::Base
Instance Method Details
#display(attribute_name, label, options = {}, &block) ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'app/attribute_renderers/attachment_renderer.rb', line 2 def display(attribute_name, label, = {}, &block) .reverse_merge!(format: :long) format = .delete(:format) h.link_to(value_for_attribute(attribute_name).url) do h.tag(:span, class: 'btn btn-xs btn-primary btn-responsive') + h.content_tag(:span, h.t(".download"), class: 'btn-text') end end |