Sha256: fa7571a2d1d507463b3d4608396a389c4288152236f6e860c2911c35405a794a

Contents?: true

Size: 1.52 KB

Versions: 4

Compression:

Stored size: 1.52 KB

Contents

<%%- model_class = <%= model.name.sub(/\ATemplate::/, '::Template::') %> -%>
<div class="page-header">
  <h1><%%=t '.title', :default => model_class.model_name.human.titleize %></h1>
</div>

<dl class="dl-horizontal">
<%- model.columns_for(:show).each do |column| -%>
  <dt><strong><%%= model_class.human_attribute_name(:<%= column.name %>) %>:</strong></dt>
  <%- if tcol = column.ref_model.try(:title_column) -%>
  <dd><%%= @<%= model.full_resource_name %>.<%= column.reference.name %>.<%= tcol.name %> %></dd>
  <%- elsif column.enumerized? -%>
  <dd><%%= @<%= model.full_resource_name %>.<%= column.name %>_text %></dd>
  <%- elsif column.to_be_localized? -%>
  <dd><%%=l @<%= model.full_resource_name %>.<%= column.name %> %></dd>
  <%- else -%>
  <dd><%%= @<%= model.full_resource_name %>.<%= column.name %> %></dd>
  <%- end -%>
<%- end -%>
</dl>

<%%= link_to t('.back', :default => t("helpers.links.back")),
              <%= controller_routing_path %>_path, :class => 'btn btn-default'  %>
<%%= link_to t('.edit', :default => t("helpers.links.edit")),
              edit_<%= singular_controller_routing_path %>_path(@<%= model.full_resource_name %>), :class => 'btn btn-default' %>
<%%= link_to t('.destroy', :default => t("helpers.links.destroy")),
              <%= singular_controller_routing_path %>_path(@<%= model.full_resource_name %>),
              :method => 'delete',
              :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
              :class => 'btn btn-danger' %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
model_base_generators-0.2.3 lib/templates/erb/scaffold/show.html.erb
model_base_generators-0.2.2 lib/templates/erb/scaffold/show.html.erb
model_base_generators-0.2.1 lib/templates/erb/scaffold/show.html.erb
model_base_generators-0.2.0 lib/templates/erb/scaffold/show.html.erb