Class: TagListRenderer

Inherits:
ResourceRenderer::AttributeRenderer::Base
  • Object
show all
Defined in:
app/attribute_renderers/tag_list_renderer.rb

Instance Method Summary collapse

Instance Method Details

#display(attribute_name, _label, _options = {}, &_block) ⇒ Object



2
3
4
5
6
7
# File 'app/attribute_renderers/tag_list_renderer.rb', line 2

def display(attribute_name, _label, _options = {}, &_block)
  tag_list = value_for_attribute(attribute_name)
  output = tag_list.collect do |tag|
    h.(:span, tag, class: 'label label-default')
  end.join(' ').html_safe
end