Sha256: 59bc41b4cf14a5904f6a03126baf43623d7118b0f7ecc059c9e7b2bcb862898a

Contents?: true

Size: 548 Bytes

Versions: 28

Compression:

Stored size: 548 Bytes

Contents

module EveApp::EntityHelper
  def entity(record, size: :medium, description: nil, link_url: nil)
    title = link_url ? link_to(record.name, link_url) : record.name
    body = [
      content_tag(:h6, title.html_safe),
      content_tag(:div, description || record.try(:description), class: 'text-sm text-muted')
    ].join("\n").html_safe
    wrapper = [
      image_tag(record.image),
      content_tag(:div, body, class: "media-body")
    ].join("\n").html_safe

    raw content_tag(:div, wrapper, class: "media media-entity #{size}")
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
eve_app-0.1.34 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.33 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.32 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.31 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.29 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.27 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.22 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.21 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.20 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.19 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.18 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.17 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.16 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.14 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.13 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.12 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.11 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.10 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.9 app/helpers/eve_app/entity_helper.rb
eve_app-0.1.8 app/helpers/eve_app/entity_helper.rb