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