Class: Tramway::Api::V1::ApplicationController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tramway/api/v1/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#render_error_with_text(text) ⇒ Object



9
10
11
# File 'app/controllers/tramway/api/v1/application_controller.rb', line 9

def render_error_with_text(text)
  render json: { text: text }, status: :bad_request
end

#render_errors_for(model) ⇒ Object



5
6
7
# File 'app/controllers/tramway/api/v1/application_controller.rb', line 5

def render_errors_for(model)
  render json: model, status: :unprocessable_entity, serializer: ::Tramway::Api::V1::ErrorSerializer
end