From 34fb69e44457437b93c2c683d15dded5e81a4cae Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 16 Nov 2007 00:17:37 +0000 Subject: [PATCH] missing views git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@28 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7 --- app/views/beers/edit.rhtml | 15 +++++++++++++++ app/views/beers/index.rhtml | 25 +++++++++++++++++++++++++ app/views/beers/new.rhtml | 14 ++++++++++++++ app/views/beers/show.rhtml | 21 +++++++++++++++++++++ 4 files changed, 75 insertions(+) create mode 100644 app/views/beers/edit.rhtml create mode 100644 app/views/beers/index.rhtml create mode 100644 app/views/beers/new.rhtml create mode 100644 app/views/beers/show.rhtml diff --git a/app/views/beers/edit.rhtml b/app/views/beers/edit.rhtml new file mode 100644 index 0000000..1d6f91a --- /dev/null +++ b/app/views/beers/edit.rhtml @@ -0,0 +1,15 @@ +

Editing beer

+ +<%= error_messages_for :beer %> + +<% form_for(:beer, :url => beer_path(@beer.page.title_for_url), :html => { :method => :put }) do |f| %> +<%= render :partial => 'beer_form' %> +

+ <%= submit_tag "Update" %> +

+<% end -%> + + \ No newline at end of file diff --git a/app/views/beers/index.rhtml b/app/views/beers/index.rhtml new file mode 100644 index 0000000..1dacf5c --- /dev/null +++ b/app/views/beers/index.rhtml @@ -0,0 +1,25 @@ +

The Beers

+ +<% unless @beers.empty? -%> + + + + + + + +<% for beer in @beers %> + + + + + +<% end %> +
Beer
<%= link_to beer.title, beer_path(beer.page.title_for_url) %><%= link_to 'Edit', edit_beer_path(beer.page.title_for_url) %><%= link_to 'Destroy', beer_path(beer.page.title_for_url), :confirm => 'Are you sure?', :method => :delete %>
+<% end -%> + +
+ + \ No newline at end of file diff --git a/app/views/beers/new.rhtml b/app/views/beers/new.rhtml new file mode 100644 index 0000000..861bedb --- /dev/null +++ b/app/views/beers/new.rhtml @@ -0,0 +1,14 @@ +

Create a new beer

+ +<%= error_messages_for :beer %> + +<% form_for(:beer, :url => beers_path, :html => { :method => :post }) do |f| %> +<%= render :partial => 'beer_form' %> +

+ <%= submit_tag "Create" %> +

+<% end -%> + + \ No newline at end of file diff --git a/app/views/beers/show.rhtml b/app/views/beers/show.rhtml new file mode 100644 index 0000000..8e2889f --- /dev/null +++ b/app/views/beers/show.rhtml @@ -0,0 +1,21 @@ +

<%= @beer.title -%>

+ +<% + 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? +-%> +
+

Useful attributes

+ +
+<% end -%> + +<%= @page.html %> + + \ No newline at end of file