Class: Account::NotesController

Inherits:
BaseController show all
Defined in:
app/controllers/account/notes_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

caches_page_with_cache_marker, #raise_not_found!

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/account/notes_controller.rb', line 10

def create
  @note.order_id = params[:part_id] if params[:part_id].present?
  @note.order_id ||= params[:order_id]
  begin
    @note.submit if @note.valid?
  rescue JsonApiClient::Errors::ApiError
    @note.errors.add('content', :invalid)
  end
  respond_with(@note, location: (@note.order_id))
end