Module: Controller::Actions::Update
- Defined in:
- lib/resourcify/controller/actions/update.rb
Instance Method Summary collapse
Instance Method Details
#update ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/resourcify/controller/actions/update.rb', line 3 def update @record if @record.update(permitted_params) 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 |