AlchemyCMS/alchemy_cms

View on GitHub
lib/generators/alchemy/elements/templates/view.html.erb

Summary

Maintainability
Test Coverage
<%%- cache(<%= @element_name %>) do -%>
  <%%= element_view_for(<%= @element_name %>) do |el| -%>
  <%- @ingredients.each do |ingredient| -%>
    <%- if @ingredients.length > 1 -%>
    <div class="<%= ingredient["role"] %>">
      <%%= el.render(:<%= ingredient["role"] %>) %>
    </div>
    <%- else -%>
    <%%= el.render(:<%= ingredient["role"] %>) %>
    <%- end -%>
  <%- end -%>
  <%- if @element['nestable_elements'].present? -%>
    <%%= render <%= @element_name %>.nested_elements.published %>
  <%- end -%>
  <%%- end -%>
<%%- end -%>