Error is:
NoMethodError: You have a nil object when you didn''t expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
from /www/gems/gems/activeresource-2.0.2/lib/active_resource/
base.rb:817:in `id_from_response''
from /www/gems/gems/activeresource-2.0.2/lib/active_resource/
base.rb:804:in `create''
from /www/gems/gems/activesupport-2.0.2/lib/active_support/
core_ext/object/misc.rb:28:in `returning''
from /www/gems/gems/activeresource-2.0.2/lib/active_resource/
base.rb:803:in `create''
from /www/gems/gems/activeresource-2.0.2/lib/active_resource/
base.rb:636:in `save_without_validation''
from /www/gems/gems/activeresource-2.0.2/lib/active_resource/
validations.rb:262:in `save''
from /data/www/rails/authentication/app/models/account.rb:
89:in `create_notification''
from /www/gems/gems/activerecord-2.0.2/lib/active_record/
associations/association_proxy.rb:125:in `send''
from /www/gems/gems/activerecord-2.0.2/lib/active_record/
associations/association_proxy.rb:125:in `method_missing''
Client:
notification_email.rb model
class NotificationEmail < ActiveResource::Base
self.site = "[http://mysite]"
end
I use the model class to create a new object. Error happens on save.
def create_notification
n = NotificationEmail.new
n.save
end
Web service set up is very simple. It basically saves the record to
the database. I tested it with curl and it works. Anyone has any
ideas what this error message means?
Thank you!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---