Module: Controller::Actions::Destroy
- Defined in:
- lib/resourcify/controller/actions/destroy.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/resourcify/controller/actions/destroy.rb', line 3 def destroy @record if @record.destroy render json: @record else @error[:type] = 'Validation' @error[:message] = 'Sorry, there were validation errors.' @error[:errors] = @record.errors. @error[:messages] = @record.errors. render json: @error end end |