similar to: ActiveResource sample code?

Displaying 20 results from an estimated 1000 matches similar to: "ActiveResource sample code?"

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
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
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
2010 May 15
3
ActiveResource Mock Objects
Some of my tests use ActiveResource HttpMock requests and some of them do not. Does anyone know if there is a way to disable the HttpMocks after they have already been loaded? The method ActiveResource::HttpMock.reset! only removes all the objects, but ActiveResource still thinks it should look for mock requests rather than actually making requests. I hope this makes sense! Thanks, Tom --
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
2011 Oct 16
4
Ruby on rails with twitter integration
after i searched, i got so many links related with the twitter integration , Then i do that with one following link http://cbpowell.wordpress.com/2011/03/17/twitter-oauth-and-ruby-on-rails-integrated-cookbook-style-in-the-console-updated-for-twitter-1-0/ after some steps with the rails console, *Then i got some errors after i gave the steps to send the tweet from the application * * client
2007 Sep 28
4
RSpec + EdgeRails on Windows
I recently post on my blog about setting up a Rails environment with RSpec in Windows, and someone left a comment saying that it doesn''t work in EdgeRails. I so I played around with it a bit and was able to confirm that none RSpec appears broken on EdgeRails. I''ll post the various error messages I received below. I''m not expecting any sort of patch or something for this
2009 Mar 27
1
UTF8 postgres args saving issue
Hi, All I have an encountered an issue where the args field is not saved correctly to the database. I encounter an error like this: ActiveRecord::StatementInvalid (RuntimeError: ERROR C22021 M invalid byte sequence for encoding "UTF8": 0xcb3a H This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by
2006 Nov 22
3
RESTful web service design question
I''m working on a Rails app that needs to expose a RESTful web service. I''m curious to know some of the best practices as it relates to RESTful API design. Let''s say I have a set of related objects on the server side. I''ll use the venerable subscribers, subscriptions and magazines example to lay it out. class Subscriber < AR has_many :subscriptions
2010 Jun 17
2
"LoadError: no such file to load -- openssl", following Rails Guides
[With apologies for cross-posting at http://railsforum.com/viewtopic.php?id=39587] Hi all, I''m following the edge ''getting started'' guide at http://guides.rails.info/getting_started.html, running ROR 3. I''m running Ruby 1.9.2 (as instructed by the guide), installed using RVM. I get an error when following "4.3 Setting the Application Home Page".
2006 Nov 16
2
test unit approach?
I''m just getting back to looking at backgroundrb after a long hiatus since June. I''m looking at creating some workers but I''m a bit stuck as to how I should write tests for them. What''s the recommended approach for unit testing of workers? The project will ultimately be used by a Rails app but I''m comfortable developing the worker code as a
2007 Mar 10
6
ActiveResources 0.1.0 Released
See the blog post at http://blog.lonestarsoftware.net/2007/03/09/active_resources-010-released/ Reading through the rails blogosphere last week, I read a post (which I can not find again) that suggested a completely different approach to AJAX use in rails apps. The idea was to create a Javascript proxy to the ActiveRecord models and allow AR operations to be called from the client. I see this
2006 May 21
12
TDD for Rails book?
It seems like half the people on this list are writing a book on Ruby or Rails. For all the hints I''ve seen strewn across the list I have yet to see one that will focus on test-driven development for either Ruby or for Rails. If anyone is looking for a topic, please consider this. I''ve been trying to wrap my brain around the TDD process, but its way of thinking is
2009 May 28
0
Re: ActiveResource as API test rig? Two jsons?
bump... On Wed, May 20, 2009 at 3:57 PM, Marc Byrd <dr.marc.byrd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Hi, > > I''m using ActiveResource as an API test rig for an API we''re developing for > our PHP app - the goal being to validate that we''re following some > externally validated conventions for ReSTful API and that we can support at >
2006 May 20
10
HOW TO create a new record and its associated objects within the SAME PAGE
hi, can''t find any good tutorial or advice to deal with the creation of a new record and it''s associated objects within the same page. do i have to use ajax just to add custom form fields that will be handled by the controller for associated objects creation.? do i have to use ajax to add associated objects to the unsaved but allready in session parent object? what''s
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
2007 Feb 07
5
Mocking ActiveResource
I want to use ActiveResource in my app. Instead of hitting server though, I want it to load from a file when I call find. Any clue how I do that? Pat
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
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
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