Sha256: f8bd0e25aeec46ba8112bf2ee4c8455a02b1f1b3d3ced11db1c8ed731c1ce6c4

Contents?: true

Size: 1.41 KB

Versions: 2

Compression:

Stored size: 1.41 KB

Contents

<%% content_for :body_content_title do %>
  <%%= @<%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>.<%= title.name %><% else %>.title<% end %> %>
<%% end %>

<%% content_for :body do %>
<% attributes.each do |attribute| -%>
  <section>
    <h1><%= attribute.name.titleize %></h1>
    <p>
<% if attribute.type.to_s == 'image' -%>
      <%%= image_fu @<%= singular_name %>.<%= attribute.name %>, nil %>
<% elsif attribute.type.to_s == 'resource' -%>
      <%% if @<%= singular_name %>.<%= attribute.name %>.present? %>
        <%%= link_to <%= "'#{attribute.name}'" %>, @<%= singular_name %>.<%= attribute.name %>.url %>
      <%% else %>
        <%= attribute.name %>
      <%% end %>
<% else -%>
      <%%=raw @<%= singular_name %>.<%= attribute.name %> %>
<% end -%>
    </p>
  </section>
<% end -%>
<%% end %>

<%% content_for :side_body do %>
  <aside>
    <h2><%%= t('.other') %></h2>
    <ul id="<%= plural_name %>">
      <%% @<%= "all_" if plural_name == singular_name%><%= plural_name %>.each do |<%= singular_name %>| %>
        <li>
          <%%= link_to <%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>.<%= title.name %><% else %>.title<% end %>, answers.<%= namespacing.underscore %>_<%= singular_name %>_path(<%= singular_name %>) %>
        </li>
      <%% end %>
    </ul>
  </aside>
<%% end %>

<%%= render '/answers/content_page' %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
answers-core-0.0.0.2 lib/generators/answers/engine/templates/app/views/answers/namespace/plural_name/show.html.erb
answers-core-0.0.0 lib/generators/answers/engine/templates/app/views/answers/namespace/plural_name/show.html.erb