missing views
git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@28 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7master
parent
c2c17af726
commit
34fb69e444
|
@ -0,0 +1,15 @@
|
|||
<h1>Editing beer</h1>
|
||||
|
||||
<%= error_messages_for :beer %>
|
||||
|
||||
<% form_for(:beer, :url => beer_path(@beer.page.title_for_url), :html => { :method => :put }) do |f| %>
|
||||
<%= render :partial => 'beer_form' %>
|
||||
<p>
|
||||
<%= submit_tag "Update" %>
|
||||
</p>
|
||||
<% end -%>
|
||||
|
||||
<div id="related_links">
|
||||
<%= link_to 'Show', beer_path(@beer.page.title_for_url) %> |
|
||||
<%= link_to 'Beers', beers_path %>
|
||||
</div>
|
|
@ -0,0 +1,25 @@
|
|||
<h1>The Beers</h1>
|
||||
|
||||
<% unless @beers.empty? -%>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Beer</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% for beer in @beers %>
|
||||
<tr>
|
||||
<td><%= link_to beer.title, beer_path(beer.page.title_for_url) %></td>
|
||||
<td><%= link_to 'Edit', edit_beer_path(beer.page.title_for_url) %></td>
|
||||
<td><%= link_to 'Destroy', beer_path(beer.page.title_for_url), :confirm => 'Are you sure?', :method => :delete %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% end -%>
|
||||
|
||||
<br />
|
||||
|
||||
<div id="related_links">
|
||||
<%= new_beer_link %>
|
||||
</div>
|
|
@ -0,0 +1,14 @@
|
|||
<h1>Create a new beer</h1>
|
||||
|
||||
<%= error_messages_for :beer %>
|
||||
|
||||
<% form_for(:beer, :url => beers_path, :html => { :method => :post }) do |f| %>
|
||||
<%= render :partial => 'beer_form' %>
|
||||
<p>
|
||||
<%= submit_tag "Create" %>
|
||||
</p>
|
||||
<% end -%>
|
||||
|
||||
<div id="related_links">
|
||||
<%= link_to 'Beers', beers_path %>
|
||||
</div>
|
|
@ -0,0 +1,21 @@
|
|||
<h1><%= @beer.title -%></h1>
|
||||
|
||||
<%
|
||||
attributes = []
|
||||
attributes << "ABV: #{abv(@beer)}" unless @beer.abv.to_s.empty?
|
||||
attributes << "Original Gravity: #{@beer.original_gravity}" unless @beer.original_gravity.to_s.empty?
|
||||
attributes << "Final Gravity: #{@beer.final_gravity}" unless @beer.final_gravity.to_s.empty?
|
||||
unless attributes.empty?
|
||||
-%>
|
||||
<div id="attributes">
|
||||
<h3>Useful attributes</h3>
|
||||
<ul><li><%= attributes.join('</li><li>') -%></ul>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<%= @page.html %>
|
||||
|
||||
<div id="related_links">
|
||||
<%= link_to 'Edit', edit_beer_path(@beer) %> |
|
||||
<%= link_to 'Beers', beers_path %>
|
||||
</div>
|
Reference in New Issue