Class: OrderCommentsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

current

Methods included from PathHelper

#finance_group_transactions_path

Instance Method Details

#createObject



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

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



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

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