From d1ee9dede02e81f0aa4e68c8b33b29766ac2d1ca Mon Sep 17 00:00:00 2001 From: Kensuke Kaneko Date: Tue, 19 Jan 2010 19:06:34 +0900 Subject: [PATCH] modify views. --- depot/app/views/products/edit.html.erb | 4 ++++ depot/app/views/products/index.html.erb | 2 ++ depot/app/views/products/new.html.erb | 4 ++++ depot/app/views/products/show.html.erb | 5 +++++ 4 files changed, 15 insertions(+) diff --git a/depot/app/views/products/edit.html.erb b/depot/app/views/products/edit.html.erb index af3b747..7aa095b 100644 --- a/depot/app/views/products/edit.html.erb +++ b/depot/app/views/products/edit.html.erb @@ -15,6 +15,10 @@ <%= f.label :image_url %>
<%= f.text_field :image_url %>

+

+ <%= f.label :price %>
+ <%= f.text_field :price %> +

<%= f.submit "Update" %>

diff --git a/depot/app/views/products/index.html.erb b/depot/app/views/products/index.html.erb index 88120ee..98bff9a 100644 --- a/depot/app/views/products/index.html.erb +++ b/depot/app/views/products/index.html.erb @@ -5,6 +5,7 @@ Title Description Image url + Price <% for product in @products %> @@ -12,6 +13,7 @@ <%=h product.title %> <%=h product.description %> <%=h product.image_url %> + <%=h product.price %> <%= link_to 'Show', product %> <%= link_to 'Edit', edit_product_path(product) %> <%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %> diff --git a/depot/app/views/products/new.html.erb b/depot/app/views/products/new.html.erb index f935937..26ca14a 100644 --- a/depot/app/views/products/new.html.erb +++ b/depot/app/views/products/new.html.erb @@ -15,6 +15,10 @@ <%= f.label :image_url %>
<%= f.text_field :image_url %>

+

+ <%= f.label :price %>
+ <%= f.text_field :price %> +

<%= f.submit "Create" %>

diff --git a/depot/app/views/products/show.html.erb b/depot/app/views/products/show.html.erb index a5f0eac..124ab77 100644 --- a/depot/app/views/products/show.html.erb +++ b/depot/app/views/products/show.html.erb @@ -13,6 +13,11 @@ <%=h @product.image_url %>

+

+ Price: + <%=h @product.price %> +

+ <%= link_to 'Edit', edit_product_path(@product) %> | <%= link_to 'Back', products_path %>