Method: SupplejackApi::RecordsController#show

Defined in:
app/controllers/supplejack_api/records_controller.rb

#showObject



39
40
41
42
43
44
# File 'app/controllers/supplejack_api/records_controller.rb', line 39

def show
  @record = SupplejackApi::Record.custom_find(params[:id], current_user, params[:search])
  respond_with @record, serializer: RecordSerializer
rescue Mongoid::Errors::DocumentNotFound
  render request.format.to_sym => { errors: "Record with ID #{params[:id]} was not found" }, status: :not_found
end