[ap4r-devel] [256] branches/200709_gihyo/async_shop/as_rails/app: Fixed: trivial bugs.
kato-k at rubyforge.org
kato-k at rubyforge.org
Fri Aug 24 03:11:18 EDT 2007
Revision: 256
Author: kato-k
Date: 2007-08-24 03:11:18 -0400 (Fri, 24 Aug 2007)
Log Message:
-----------
Fixed: trivial bugs.
Modified Paths:
--------------
branches/200709_gihyo/async_shop/as_rails/app/controllers/async_shop_controller.rb
branches/200709_gihyo/async_shop/as_rails/app/views/async_shop/list.rhtml
Modified: branches/200709_gihyo/async_shop/as_rails/app/controllers/async_shop_controller.rb
===================================================================
--- branches/200709_gihyo/async_shop/as_rails/app/controllers/async_shop_controller.rb 2007-08-24 05:44:45 UTC (rev 255)
+++ branches/200709_gihyo/async_shop/as_rails/app/controllers/async_shop_controller.rb 2007-08-24 07:11:18 UTC (rev 256)
@@ -18,7 +18,6 @@
ActiveRecord::Base.transaction do
@order = Order.new(params[:order])
@order.save
- raise Exception
payment(@order[:id])
flash[:notice] = 'Order was successfully created.'
Modified: branches/200709_gihyo/async_shop/as_rails/app/views/async_shop/list.rhtml
===================================================================
--- branches/200709_gihyo/async_shop/as_rails/app/views/async_shop/list.rhtml 2007-08-24 05:44:45 UTC (rev 255)
+++ branches/200709_gihyo/async_shop/as_rails/app/views/async_shop/list.rhtml 2007-08-24 07:11:18 UTC (rev 256)
@@ -6,19 +6,19 @@
<th>Ordered at</th>
<th>Payed at<th>
</tr>
-
+
<% for order in @orders %>
<tr>
<td><%=h order.item %></td>
<td><%=h order.created_at %></td>
- <td><%=h begin Payment.find(order.id).created_at rescue "not yet." end %></td>
+ <td><%=h begin Payment.find_by_order_id(order.id).created_at rescue "not yet." end %></td>
<td><%= link_to 'Destroy', { :action => 'destroy', :id => order }, :confirm => 'Are you sure?', :method => :post %></td>
</tr>
<% end %>
</table>
<%= link_to 'Previous page', { :page => @order_pages.current.previous } if @order_pages.current.previous %>
-<%= link_to 'Next page', { :page => @order_pages.current.next } if @order_pages.current.next %>
+<%= link_to 'Next page', { :page => @order_pages.current.next } if @order_pages.current.next %>
<br />
More information about the ap4r-devel
mailing list