Advertisement
Guest User

modelo de respuesta

a guest
May 15th, 2018
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.47 KB | None | 0 0
  1.   def update
  2.     begin
  3.       if @brand.update brands_params
  4.         render json: { message: "successfully updated"}
  5.       else
  6.         response_error(title: 'No se pudo actualizar', reasons: {base: @brand.errors}, description: "Los atributos son invalidos", status_code: 422)
  7.       end
  8.     rescue Exception => e
  9.       response_error(title: 'No se pudo actualizar', reasons: {base: @brand.errors}, description: "Los atributos son invalidos", status_code: 422)
  10.     end
  11.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement