Class: OrderCommentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/order_comments_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

current

Instance Method Details

#createObject


8
9
10
11
12
13
14
15
# File 'app/controllers/order_comments_controller.rb', line 8

def create
  @order_comment = OrderComment.new(params[:order_comment])
  if @order_comment.save
    render :layout => false
  else
    render :action => :new, :layout => false
  end
end

#newObject


3
4
5
6
# File 'app/controllers/order_comments_controller.rb', line 3

def new
  @order = Order.find(params[:order_id])
  @order_comment = @order.comments.build(:user => current_user)
end