<% content_for :title, "Static Pages" %>

<div class="center"><%= link_to 'New Static page', new_static_page_path, class: "btn btn-primary btn-sm" %></div><br />

<table class="table table-striped table-hover">
  <thead>
    <tr class="warning">
      <th>Name</th>
      <th>Body</th>
      <th></th>
    </tr>
  </thead>

  <tbody>
    <% @static_pages.each do |static_page| %>
      <tr class="<%= cycle('info', 'success') %>">
        <td><%= static_page.name %></td>
        <td><%= static_page.body %></td>
        <td style="text-align: right;"><%= link_to 'Show', static_page, class: "btn btn-success btn-xs" %>
          <%= link_to 'Edit', edit_static_page_path(static_page), class: "btn btn-warning btn-xs" %>
          <%= link_to 'Destroy', static_page, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-danger btn-xs" %></td>
      </tr>
    <% end %>
  </tbody>
</table>
<% content_for :title, "Static Pages" %>

<div class="center"><%= link_to 'New Static page', new_static_page_path, class: "btn btn-primary btn-sm" %></div><br />

<table class="table table-striped table-hover">
  <thead>
    <tr class="warning">
      <th>Name</th>
      <th>Body</th>
      <th></th>
    </tr>
  </thead>

  <tbody>
    <% @static_pages.each do |static_page| %>
      <tr class="<%= cycle('info', 'success') %>">
        <td><%= static_page.name %></td>
        <td><%= truncate(strip_tags(static_page.body), length: 60) %></td>
        <td style="text-align: right;"><%= link_to 'Show', static_page, class: "btn btn-success btn-xs" %>
          <%= link_to 'Edit', edit_static_page_path(static_page), class: "btn btn-warning btn-xs" %>
          <%= link_to 'Destroy', static_page, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-danger btn-xs" %></td>
      </tr>
    <% end %>
  </tbody>
</table>
Truncate body in static pages
Truncate body in static pages
