Displaying 20 results from an estimated 4000 matches similar to: "retrieving ActiveResource validation errors on attributes"
2007 May 14
6
ActiveResource and RESful edit
Hi
I''d like to know how to have ActiveResource generate a URL for the
/teams/1/edit
type of resource.
I''ve got custom_methods.rb and have used
Team.find(1).get(:edit)
This generates
http://localhost:xxxx/teams/1/edit.xml
But all I get returned is a hash of the attributes (in this case of
team 1), rather than an object of team 1.
In other words the
2009 Apr 18
1
RESTful posting
I''m implementing a Rails front end to a Windows system by using RESTful
web services to send data back and forth. Luckyly all the business
objects in the Windows system know how to serialize themselves into XML
so it''s not too complicated.
But when I looked at the XML that gets sent back to the service in a
POST when you do a myresource.save, all the fields that had underscores
2010 Apr 05
2
Harmonizing JSON/XML serialization
The way Rails handles root nodes in JSON and XML serialization is
inconsistent. This has been discussed before:
https://rails.lighthouseapp.com/projects/8994/tickets/2584-232-activeresource-json-doesnt-send-parameters-with-root-node
This seems mostly taken care of with
ActiveModel::Base.include_root_in_json, especially if/when it ends up
in ActiveResource. However, there is also the issue of how
2007 May 17
4
Namespaced model valid #to_xml support in ActiveRecord, ActiveSupport and ActiveResource
Hi,
Attached are links to two patches I submitted via the RoR Trac system
a week or so ago:
http://dev.rubyonrails.org/ticket/8305
http://dev.rubyonrails.org/ticket/8308
I refrained from creating a new Trac ticket for ARes, which will be
affected if both of these patches are accepted by Core.
There are a couple of workarounds for this issue, but it would be nice
for AR, AS and ARes to output
2006 Jun 28
0
ActiveResource (was: 1.1.3 available.)
2006/6/28, Paul Barry <mail@paulbarry.com>:
> Where can I find info about the "CRUD/resource-based features" that will be
> in 1.2.0?
In blogs. Especially about Railsconf and DHH''s keynotes.
In trunk : http://dev.rubyonrails.org/browser/trunk/activeresource
In DHH slides :
Transcription of some slides from DHH''s talk at RubyKaigi 2006
(I suppose it must
2006 Sep 01
2
Include ActiveResource
Hello,
I want to give ActiveResource a spin.
I have all the code checked out from SVN in vendor/rails (yes, including
ActiveResource).
I''m trying to make sure it gets loaded.
I did this in environment.rb:
config.load_paths += %W( #{RAILS_ROOT}/vendor/rails/activeresource/lib )
Unfortunately I still can''t use it. I have an ActiveResource derived model,
Address:
class
2007 Sep 22
4
ActiveResource, find(1) works but no find(:all)
Hi,
I''m on edge and Fuser.find(1) works but Fuser.find(:all) shows the error
[1]. Fuser is declared here [2]. Do you know what''s happening? Thanks.
[1]
ActiveResource::ServerError: Failed with 500 Internal Server Error
from
/.../vendor/rails/activeresource/lib/active_resource/connection.rb:124:in
`handle_response''
from
2011 Feb 28
3
Feature: ActiveResource - Adding associations through reflections
Hello everyone,
I''m new in contributing and i saw in the contributing-guides, that i
have to write an email at this list.
I hope, that''s the right place for this. If it''s not, i''M really
sorry.. ;)
Could someone please give me feedback about this lighthouse-ticket?
2008 Jan 08
1
howto rebuild a object from a received xml hash structure ?
im my web server app , i have an action to be used as a REST web
service
# GET /user/membership.xml?email=emailaddress
def membership
@user = User.find_by_email(params[:email])
respond_to do |format|
format.xml { render :xml => @user.to_xml( :only =>
[ :first_name, :last_name, :display_name, :membership_type, :membership_at], :skip_types
=> true)}
end
end
my
2007 Aug 22
1
ActiveResource find method and restful controllers.
Hi,
What''s the best way to add support for the activeresource find method
in the controllers in my rails app?
As I understand it when you invoke something like:
Person.find(:all, :params => {:name = ''toby''})
this generates a request of:
GET /people.xml?name=toby
Does this mean that in my index method in PeopleController in my rails
app I have params[name] set to
2006 Sep 01
2
Uninitialized constant w/ ActiveResource
Howdy,
I had an application perfect for ActiveResource, which I do realize is not
finished.
Anyway, I froze my app to edge and then defined a class:
class Address < ActiveResource::Base
self.site = "http://ws.geonames.org/findNearestAddress?lat=:lat&lng=:long"
End
I tried to use it from the console but I get the trace below.
It appears it can''t
2008 Sep 28
4
ActiveResource and InvalidAuthenticityToken exception
Hi,
I have a Rails 2.1.1 web app, and a Rails 2.1.1 app acting as a client
by using ActiveResource.
From the client, I can find, create, and update resources owned by the
web app.
However, I can not delete any. Calling the .destroy method in
ActiveResource generates a 422 from the web app.
Not sure why this would be the case, since I thought
protect_from_forgery only protects HTML and JS
2009 May 20
1
activeresource-2.3.2 HTTPHeaderSyntaxError
Hi,
I''m upgrading my app from 2.2.2 to 2.3.2 and am having a problem with
ActiveResource.
class FooResource < ActiveResource::Base
self.site = "whatever"
self.element_name = "foo"
end
FooResource.create(:bar => ''baz'')
raises:
Net::HTTPHeaderSyntaxError: wrong Content-Length format
from
2009 Jul 24
1
Modifying ActiveResource classes
I''ve been struggling with an issue with ActiveResource for a bit now:
when a hostname resolves for an ActiveResource request, but there''s no
server on the other end to return information, ActiveResource''s timeout
value doesn''t work. The request just hangs.
After reviewing the ActiveResource code, I''ve realized that this is
because the underlying
2009 Jun 24
3
ActiveResource:: HttpMock
I''m trying to set up testing on my ActiveResource project. The
HttpMock appears to be what I want, but whenever I use the code in the
"documentation", I get the error
NameError: uninitialized constant ActiveResource::HttpMock
Is there something I need to do to enable HttpMock testing?
Thanks,
Tom
2007 Jun 21
2
does activeresource only work with edge?
hey all,
I''ve just installed the activeresource gem and it wasn''t working, so I
did gem update rails and it worked. But now I have rails-1.2.3.6906
and I think this is edge right? Is there a way to work on regular
rails 1.2.3 with activeresource?
thanx in advance
Pat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to
2006 Aug 05
4
Can we use ActiveResource yet?
I need to split some information up between two servers, and wanted to
use REST for it. I can write the REST server really easily...but I
don''t know how I can actually use it. I downloaded Rails trunk to
mess with ActiveResource, but it seems that it doesn''t have create
functionality enabled yet.
Is it possible to use AR fully? If not, what''s the best way to
consume
2008 Feb 05
9
ActiveResource / Creating an API
Hi,
I am currently looking at creating an api for a new RESTful app built
using rails 2.0. The two solutions I have come across seems to be
ActiveResource and ActionWebServices.
Although there seems to be plenty of documentation for the older
ActionWebServices (both online and in books), this does not seem to be
the case for ActiveResource.
Does anyone know of any decent articles / screencasts
2007 Jul 04
1
Edge Rails required for ActiveResource
Just wanted to make sure I''m not missing anything here... I''m trying
to use ActiveResource and I was trying to avoid using Edge Rails.
However, since ActiveResource depends on the edge version of
activesupport, I appear to be stuck going edge... have flailed around
for a while trying to get ActiveResource to work with 1.2.3 but it
just ain''t happening. Am I right? Gotta
2009 Jul 16
1
ActiveResource timeout not functioning?
I''m trying to contact a REST API using ActiveResource on Rails 2.3.2.
I''m attempting to use the timeout functionality so that if the resource
I''m contacting is down I can fail quickly - I''m doing this with the
following:
class WorkspaceResource < ActiveResource::Base
self.timeout = 5
self.site = "http://mysite.com/restAPI"
end
However, when I