ActiveResource does not detect errors for my very simple model

The documentation says to return a code 422 with a packet in the
following format:

First cannot be empty

So that is what I am doing. But my model will not raise an exception
on a create call that returns such a response, and a record created
that way returns true for its valid? call.

I simply do:


Which triggers validation errors in the other application, which
responds with 422 and the following packet, because a “name” field is

Name cannot be empty

Why would ActiveResource interpret such a response as valid? Is there
something more I need to do in my model for validations to take
effect? My models themselves are dead simple:

class ApplicationResource < ActiveResource::Base = ‘http://localhost/frontend/www/api

class Menu < ApplicationResource


I referred to
and tried this with Rails 2.2.2, but got the same result. I am
guessing the issue I am experiencing is not version-specific.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs