Permalink
Browse files

Namespace fixes in the controllers

  • Loading branch information...
1 parent 0c43ca7 commit e53765e6cc2a8828857d80b604f58f36e645a667 @florida committed Nov 20, 2012
@@ -44,7 +44,7 @@ def create
respond_to do |format|
if @order.save
- format.html { redirect_to @order, notice: 'Order was successfully created.' }
+ format.html { redirect_to [:admin, @order], notice: 'Order was successfully created.' }
format.json { render json: @order, status: :created, location: @order }
else
format.html { render action: "new" }
@@ -60,7 +60,7 @@ def update
respond_to do |format|
if @order.update_attributes(params[:order])
- format.html { redirect_to @order, notice: 'Order was successfully updated.' }
+ format.html { redirect_to [:admin, @order], notice: 'Order was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
@@ -76,7 +76,7 @@ def destroy
@order.destroy
respond_to do |format|
- format.html { redirect_to orders_url }
+ format.html { redirect_to admin_orders_url }
format.json { head :no_content }
end
end
@@ -44,7 +44,7 @@ def create
respond_to do |format|
if @product.save
- format.html { redirect_to @product, notice: 'Product was successfully created.' }
+ format.html { redirect_to [:admin, @product], notice: 'Product was successfully created.' }
format.json { render json: @product, status: :created, location: @product }
else
format.html { render action: "new" }
@@ -60,7 +60,7 @@ def update
respond_to do |format|
if @product.update_attributes(params[:product])
- format.html { redirect_to @product, notice: 'Product was successfully updated.' }
+ format.html { redirect_to [:admin, @product], notice: 'Product was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
@@ -76,7 +76,7 @@ def destroy
@product.destroy
respond_to do |format|
- format.html { redirect_to products_url }
+ format.html { redirect_to admin_products_url }
format.json { head :no_content }
end
end
@@ -1,4 +1,4 @@
-<%= form_for(@order) do |f| %>
+<%= form_for [:admin, @order] do |f| %>
<% if @order.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@order.errors.count, "error") %> prohibited this order from being saved:</h2>
@@ -1,4 +1,4 @@
-<%= form_for(@product) do |f| %>
+<%= form_for [:admin, @product] do |f| %>
<% if @product.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@product.errors.count, "error") %> prohibited this product from being saved:</h2>
@@ -27,6 +27,14 @@
<%= f.label :stock_no %><br />
<%= f.number_field :stock_no %>
</div>
+ <div class="field">
+ <%= f.label :available %><br />
+ <%= f.check_box :available %>
+ </div>
+ <div class="field">
+ <%= f.label :image_url %><br />
+ <%= f.text_field :image_url %>
+ </div>
<div class="actions">
<%= f.submit %>
</div>

0 comments on commit e53765e

Please sign in to comment.