Module: Grape::App::Helpers::RespondWith
- Defined in:
- lib/grape/app/helpers/respond_with.rb
Defined Under Namespace
Classes: Errors
Instance Method Summary collapse
Instance Method Details
#respond_with(record, opts = {}) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/grape/app/helpers/respond_with.rb', line 10 def respond_with(record, opts = {}) unless record.errors.empty? opts[:with] = Errors status 400 end present record, opts end |