Questions tagged [activeresource]

ActiveResource is the main class for mapping RESTful resources as models in a Rails application

Active Resource objects represent your RESTful resources as manipulatable Ruby objects. To map resources to Ruby objects, Active Resource only needs a class name that corresponds to the resource name (e.g., the class Person maps to the resources people, very similarly to Active Record) and a site value, which holds the URI of the resources.

355 questions
0
votes
1 answer

NoMethodError (undefined method `body' for #):

Getting an obscure error which originates from the ActiveResource standard Rails library. The line within Rails causing this problem is given below along with the output. Any idea on how to resolve this problem please? class Search <…
Jones Agyemang
  • 1,230
  • 16
  • 15
0
votes
1 answer

How to return a list of all email addresses associated with a company using the basecamp API

I've managed to get this to almost work but I think I'm getting something seriously confused. All the examples seem to cover finding single records based on their id. I thought I would be able to pass a param to filter on a single…
gilesw
  • 101
  • 1
  • 4
0
votes
1 answer

design advice: Gemify ActiveResource subclass

I've been asked to build a gem out of a number of ActiveResource subclasses in a Rails app of ours. The difficulty is that the self.site call uses a constant set in the Rails environment file (so that dev, test, and production point to different…
JellicleCat
  • 28,480
  • 24
  • 109
  • 162
0
votes
1 answer

Rails: Where to store possible values of an attribute in ActiveResource

Say I have an ActiveResource which has an schema with several attributes. One of the attributes is expected to have three values (defined by the API where the ActiveResource is talking to). Since I am creating forms for this ActiveResource…
Hommer Smith
  • 26,772
  • 56
  • 167
  • 296
0
votes
1 answer

How to check for availability of an ActiveResource resource?

In my rails app, I am using ActiveResource to access another service, and I'd like to gracefully handle the exception that occurs when that resource is offline (server is down/ip is blocked etc.). With no response being returned, my app generates…
Carson Cole
  • 4,183
  • 6
  • 25
  • 35
0
votes
1 answer

Active Resource encoding issue

I have a service which returns ' 6"_x_5" ' as part of its json response, but active resource interprets this as ' 6���_x_4��� '. When i curl against the same url the response looks fine, any idea how to fix this?
MLN
  • 13,728
  • 1
  • 17
  • 15
0
votes
1 answer

Active resource after_create

I am using active resource version 3.2.1, I need a life cycle method like after_create where I can do some post initialization stuff. I know this is coming in next version of active resource, was wondering how people solve this problem right now…
MLN
  • 13,728
  • 1
  • 17
  • 15
0
votes
2 answers

Consuming a Restful WCF Service with Ruby ActiveResource

I'm trying to consume a RESTful WCF service in a Rails app using ActiveResource. My ActiveResource class is: class PartReferenceService < ActiveResource::Base self.site = "http://localhost:1234/" end The WCF URL is…
chrisvmcd
-1
votes
1 answer

How to create a HTTP post request using the form fields to the external websites API using Ruby on Rails?

I am trying to create a HTTP post request using the form fields to the external website here it is factual.com I have created the method in the my data_controller.rb which is like def posttofactual uri =…
-1
votes
1 answer

How to override update path to patch instead of put in activerresource rails?

I am using activeresource model, I need to consume API which supports only patch request method call for updating resource. How to override the update call in Active resource model? Please advise
alex D
  • 66
  • 4
1 2 3
23
24