Skip to content

Instantly share code, notes, and snippets.

@daz
Created February 22, 2012 09:13
Show Gist options
  • Save daz/1883522 to your computer and use it in GitHub Desktop.
Save daz/1883522 to your computer and use it in GitHub Desktop.
twitter-bootstrap-rails ERB template
<%= render :partial => 'form' %>
<h1>Pages</h1>
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Created at</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% @pages.each do |page| %>
<tr>
<td><%= page.id %></td>
<td><%= link_to page.title, page_path(page) %></td>
<td><%= page.created_at %></td>
<td>
<%= link_to 'Edit', edit_page_path(page), :class => 'btn btn-mini' %>
<%= link_to 'Destroy', page_path(page), :method => :delete, :confirm => 'Are you sure?', :class => 'btn btn-mini btn-danger' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to 'New', new_page_path, :class => 'btn btn-primary' %>
<%= render :partial => 'form' %>
<h1>Page</h1>
<p>
<b>Title</b><br>
<%= @page.title %>
</p>
<p>
<b>Slug</b><br>
<%= @page.slug %>
</p>
<p>
<b>Body</b><br>
<%= @page.body %>
</p>
<div class="form-actions">
<%= link_to 'Back', pages_path, :class => 'btn' %>
<%= link_to 'Edit', edit_page_path(@page), :class => 'btn' %>
<%= link_to 'Delete', page_path(@page), :method => 'delete', :confirm => 'Are you sure?', :class => 'btn btn-danger' %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment