changelog shortlog tags manifest raw

changeset: add scaffold order (add view).

changeset 11: 094fe4526925
parent 10:c7be8325050f
child 12:755229281e85
author: moriq@moriq.com
date: Mon Mar 10 03:31:38 2008 +0900 (16 years ago)
files: .hgignore app/views/layouts/orders.html.erb app/views/orders/edit.html.erb app/views/orders/index.html.erb app/views/orders/new.html.erb app/views/orders/show.html.erb
description: add scaffold order (add view).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Mon Mar 10 03:31:38 2008 +0900
@@ -0,0 +1,6 @@
+syntax: glob
+*.swp
+*.log
+*.sqlite3
+schema.rb
+nbproject
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/views/layouts/orders.html.erb	Mon Mar 10 03:31:38 2008 +0900
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+  <title>Orders: <%= controller.action_name %></title>
+  <%= stylesheet_link_tag 'scaffold' %>
+</head>
+<body>
+
+<p style="color: green"><%= flash[:notice] %></p>
+
+<%= yield  %>
+
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/views/orders/edit.html.erb	Mon Mar 10 03:31:38 2008 +0900
@@ -0,0 +1,22 @@
+<h1>Editing order</h1>
+
+<%= error_messages_for :order %>
+
+<% form_for(@order) do |f| %>
+  <p>
+    <b>Name</b><br />
+    <%= f.text_field :name %>
+  </p>
+
+  <p>
+    <b>Email</b><br />
+    <%= f.text_field :email %>
+  </p>
+
+  <p>
+    <%= f.submit "Update" %>
+  </p>
+<% end %>
+
+<%= link_to 'Show', @order %> |
+<%= link_to 'Back', orders_path %>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/views/orders/index.html.erb	Mon Mar 10 03:31:38 2008 +0900
@@ -0,0 +1,22 @@
+<h1>Listing orders</h1>
+
+<table>
+  <tr>
+    <th>Name</th>
+    <th>Email</th>
+  </tr>
+
+<% for order in @orders %>
+  <tr>
+    <td><%=h order.name %></td>
+    <td><%=h order.email %></td>
+    <td><%= link_to 'Show', order %></td>
+    <td><%= link_to 'Edit', edit_order_path(order) %></td>
+    <td><%= link_to 'Destroy', order, :confirm => 'Are you sure?', :method => :delete %></td>
+  </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New order', new_order_path %>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/views/orders/new.html.erb	Mon Mar 10 03:31:38 2008 +0900
@@ -0,0 +1,21 @@
+<h1>New order</h1>
+
+<%= error_messages_for :order %>
+
+<% form_for(@order) do |f| %>
+  <p>
+    <b>Name</b><br />
+    <%= f.text_field :name %>
+  </p>
+
+  <p>
+    <b>Email</b><br />
+    <%= f.text_field :email %>
+  </p>
+
+  <p>
+    <%= f.submit "Create" %>
+  </p>
+<% end %>
+
+<%= link_to 'Back', orders_path %>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/views/orders/show.html.erb	Mon Mar 10 03:31:38 2008 +0900
@@ -0,0 +1,13 @@
+<p>
+  <b>Name:</b>
+  <%=h @order.name %>
+</p>
+
+<p>
+  <b>Email:</b>
+  <%=h @order.email %>
+</p>
+
+
+<%= link_to 'Edit', edit_order_path(@order) %> |
+<%= link_to 'Back', orders_path %>