Created
May 12, 2013 20:13
-
-
Save elrok123/5564748 to your computer and use it in GitHub Desktop.
Order Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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