Sha256: 09c481fa42d12ab308b2a9069233ae273dcb489c3a2b9ef56658432c5035714e

Contents?: true

Size: 1.2 KB

Versions: 4

Compression:

Stored size: 1.2 KB

Contents

<%% @title = "<%= resource_title %>: #{@<%= resource_name %>.name}" %>
<div class="page-header">
  <h1>
    <%%= @title %>
    <%%= link_to "Edit <%= resource_title %>", edit_<%= resource_name %>_path(@<%= resource_name %>), class: 'btn btn-mini' %>
    <%%= link_to "Delete <%= resource_title %>", @<%= resource_name %>, confirm: "Are you sure you want to delete <%= resource_title %> #{@<%= resource_name %>.name}?", method: :delete, class: 'btn btn-mini btn-danger' %>
    <%%= link_to "View <%= resource_title_plural %>", <%= resource_name_plural %>_path, class: 'btn btn-mini' %>
  </h1>
</div>

<dl class="dl-horizontal">
  <%- columns.each do |column| -%>
  <dt><%= column.name.titleize %></dt>
  <%- if column.name.split('_').last == 'id' -%>
  <dd><%%= link_to @<%= resource_name %>.<%= column.name.split('_')[0..-2].join('_') %>.name, @<%= resource_name %>.<%= column.name.split('_')[0..-2].join('_') %> if @<%= resource_name %>.<%= column.name.split('_')[0..-2].join('_') %> %></dd>
  <%- elsif column.field_type == :text_area -%>
  <dd><%%= simple_format @<%= resource_name %>.<%= column.name %> %></dd>
  <%- else -%>
  <dd><%%= @<%= resource_name %>.<%= column.name %> %></dd>
  <%- end -%>

  <%- end -%>
</dl>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
contour-1.0.1 lib/generators/contour/scaffold/templates/show.html.erb
contour-1.0.0 lib/generators/contour/scaffold/templates/show.html.erb
contour-1.0.0.rc2 lib/generators/contour/scaffold/templates/show.html.erb
contour-1.0.0.rc lib/generators/contour/scaffold/templates/show.html.erb