Sha256: f6b59f15e23e1ff6d05cccd406a0ff6bc7422cf04381e5b63c9d404eb27f48cc

Contents?: true

Size: 737 Bytes

Versions: 91

Compression:

Stored size: 737 Bytes

Contents

<% object ||= current_attributes_object %>
<% strategy ||= current_attributes_strategy || :none %>
<% url ||= nil %>

<% if object.public_send(attribute).present? %>
  <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
    <% # Here we manually add a trix-content class since sanitizing the body removes the Rails default. %>
    <% if object.send(attribute).is_a?(ActionText::RichText) %>
      <%= tag.div(html_sanitize(object.public_send(attribute).body.to_trix_html).html_safe, class:"trix-content") %>
    <% else %>
      <% # `.to_s` is for action text. %>
      <%= html_sanitize(object.public_send(attribute).to_s).html_safe %>
    <% end %>
  <% end %>
<% end %>

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
bullet_train-themes-1.3.10 app/views/themes/base/attributes/_html.html.erb
bullet_train-themes-1.3.9 app/views/themes/base/attributes/_html.html.erb
bullet_train-themes-1.3.8 app/views/themes/base/attributes/_html.html.erb
bullet_train-themes-1.3.7 app/views/themes/base/attributes/_html.html.erb
bullet_train-themes-1.3.6 app/views/themes/base/attributes/_html.html.erb
bullet_train-themes-1.3.5 app/views/themes/base/attributes/_html.html.erb
bullet_train-themes-1.3.4 app/views/themes/base/attributes/_html.html.erb
bullet_train-themes-1.3.3 app/views/themes/base/attributes/_html.html.erb
bullet_train-themes-1.3.2 app/views/themes/base/attributes/_html.html.erb
bullet_train-themes-1.3.1 app/views/themes/base/attributes/_html.html.erb
bullet_train-themes-1.3.0 app/views/themes/base/attributes/_html.html.erb