Skip to content

Instantly share code, notes, and snippets.

@elrok123
Created May 12, 2013 20:13
Show Gist options
  • Save elrok123/5564748 to your computer and use it in GitHub Desktop.
Save elrok123/5564748 to your computer and use it in GitHub Desktop.
Order Controller
class OrdersController < ApplicationController
def view
@orders = Order.all
end
def new
@order = Order.new
end
def create
@order = Order.new(params[:order])
if @order.save
redirect_to '/orders/view', :notice => "Order Created!"
else
render "new"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment