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
2
votes
2 answers

How to add a product variant with the Ruby gem

What is the correct way to add a product variant? I create the product successfully and it shows up in my Shopify admin. However the price is always zero and the quantity is always infinity. I've tried creating a variant with inventory_quantity and…
realdeal
  • 153
  • 1
  • 11
2
votes
0 answers

Consuming models from an API in multiple rails apps

I'm in the process of setting up a centralised data management system + CAS for a series of apps that currently have duplicated data across many databases that is a nightmare to manage. I've got the CAS system implemented nicely with rubycas-server…
Chelsea
  • 6,751
  • 5
  • 29
  • 31
1
vote
1 answer

Monkey patching ActiveResource::Errors

I've come across an issue with ActiveResource that has been resolved and was trying to monkey patch it into my application without much luck. I've added a file in config/initializers/ containing the following: class ActiveResource::Errors <…
Dan
  • 1,729
  • 1
  • 18
  • 25
1
vote
1 answer

Unfuddle API get accounts info

I'm trying to get the account info from Unfuddle API using ActiveResource The url is http://mydomain.unfuddle.com/api/v1/account this is my ActiveResource class class Account < ActiveResource::Base self.collection_name = "account" self.site =…
lesce
  • 6,224
  • 5
  • 29
  • 35
1
vote
1 answer

json to active record

I'm a bit confused, how can I take a restful JSON resource and access it as if it was a local active record using active resource? I find lots of tutorials circa 2008 but nothing that looks very recent. I currently have something like: def…
ere
  • 1,739
  • 3
  • 19
  • 41
1
vote
1 answer

How come I'm not receiving validation errors through ActiveResource

I have two Rails applications. My goal is to get one Rails application with a contact form to save information to the second Rails application via ActiveResource. I can get the resources to save just fine without validation, but once I add the…
jklina
  • 3,407
  • 27
  • 42
1
vote
2 answers

Active resource post method unwanted returned value

Googled a lot but i did not find any solution for this problem. I am using activeresource POST method to call a definition on the target application. The request is OK but the value which is returned is not what i want. The call method code is…
Jamal Abdul Nasir
  • 2,557
  • 5
  • 28
  • 47
1
vote
1 answer

Why does ActiveResource 3 namespace associations?

I'm upgrading a rail2 app to rails3, and experiencing some weird behavior with the way ActiveResource is consuming a REST api (also a rails app). The XML response from the api looks something like: Company Name
gmoniey
  • 7,975
  • 4
  • 27
  • 30
1
vote
1 answer

Parsing nil XML elements with ActiveResource

I am using ActiveResource to parse the following XML: Todd The…
user41871
1
vote
2 answers

Using ActiveSupport to convert from a utc to a ruby object

This seems like a simple problem but I can't seem to find the answer. I have a UTC time (ie. 1323481111) and I want to change it to a DateTime or TimeWithZone object in a ruby script. I haven't found a way to do it with just ruby but I believe there…
cwadding
  • 870
  • 11
  • 16
1
vote
1 answer

How to use rest-client with activeresource for a non-rails api

I need to create an interface in rails which may not work directly with activeresource. How would I create a model that uses rest-client to talk to the api directly? Would it be better for me to keep using active resource but override the default…
1
vote
1 answer

Send URL encoded data instead of JSON

Is it possible to POST "url encoded" parameters to a remote web service instead of JSON or XML ? My rails application consumes a web service which takes URL encoded parameters (content-type: application/x-www-form-urlencoded) in POST requests and…
Antoine
  • 1,782
  • 1
  • 14
  • 32
1
vote
1 answer

How do I use ActiveResource with a custom URL scheme?

I'm trying to create ActiveResource objects for three objects in an internal application. There are Tags, Taggings, and Taggables: http://tagservice/tags/:tag http://tagservice/taggings/:id http://tagservice/taggables/:type/:key Tag's :tag is the…
James A. Rosen
  • 64,193
  • 61
  • 179
  • 261
1
vote
1 answer

Device & ActiveResource

I want to have 1 database for few projects and only one of them have direct connection to db, first of all I want to implement user authentication. I should work over REST , without connecting to database. D you have any experience with devise gem…
Fivell
  • 11,829
  • 3
  • 61
  • 99
1
vote
1 answer

Self.username and password in Rails 3 Active Resource

Is the point of the self.username and self.password Active Resource fields to authenticate the application that wants to consume the API? If this is correct I would still need a separate authentication system such as sessions or cookies to manage…
user1084769
  • 49
  • 2
  • 6