Skip to content

Commit

Permalink
modify views.
Browse files Browse the repository at this point in the history
  • Loading branch information
kyanny committed Jan 19, 2010
1 parent fd81508 commit d1ee9de
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions depot/app/views/products/edit.html.erb
Expand Up @@ -15,6 +15,10 @@
<%= f.label :image_url %><br />
<%= f.text_field :image_url %>
</p>
<p>
<%= f.label :price %><br />
<%= f.text_field :price %>
</p>
<p>
<%= f.submit "Update" %>
</p>
Expand Down
2 changes: 2 additions & 0 deletions depot/app/views/products/index.html.erb
Expand Up @@ -5,13 +5,15 @@
<th>Title</th>
<th>Description</th>
<th>Image url</th>
<th>Price</th>
</tr>

<% for product in @products %>
<tr>
<td><%=h product.title %></td>
<td><%=h product.description %></td>
<td><%=h product.image_url %></td>
<td><%=h product.price %></td>
<td><%= link_to 'Show', product %></td>
<td><%= link_to 'Edit', edit_product_path(product) %></td>
<td><%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %></td>
Expand Down
4 changes: 4 additions & 0 deletions depot/app/views/products/new.html.erb
Expand Up @@ -15,6 +15,10 @@
<%= f.label :image_url %><br />
<%= f.text_field :image_url %>
</p>
<p>
<%= f.label :price %><br />
<%= f.text_field :price %>
</p>
<p>
<%= f.submit "Create" %>
</p>
Expand Down
5 changes: 5 additions & 0 deletions depot/app/views/products/show.html.erb
Expand Up @@ -13,6 +13,11 @@
<%=h @product.image_url %>
</p>

<p>
<b>Price:</b>
<%=h @product.price %>
</p>


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

0 comments on commit d1ee9de

Please sign in to comment.