foodsoft/app/controllers/order_comments_controller.rb

16 lines
386 B
Ruby
Raw Permalink Normal View History

2011-06-19 20:47:27 +02:00
class OrderCommentsController < ApplicationController
def new
@order = Order.find(params[:order_id])
@order_comment = @order.comments.build(:user => current_user)
end
def create
@order_comment = OrderComment.new(params[:order_comment])
if @order_comment.save
render :layout => false
else
render :action => :new, :layout => false
end
end
end