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

Error 404 when i use ActiveResource with Redmine

i have a problem with redmine. In fact, i've created a model who use ActiveResource : require 'active_resource' class New < ActiveResource::Base #self.site = "http://localhost:3000/" #self.format = :xml #self.user = 'admin' #self.password…
0
votes
1 answer

How do I make my app respond to a format based on a querystring parameter?

For example, I would like /apples/123?_format=json to act like /apples/123.json where it renders the *.json.* templates, executes respond_to {|format| format.json {...}}, etc. Is this at all possible? Thanks!
0
votes
1 answer

How to deploy Rails app on Heroku with Active Resource Api call to data

my Ruby on rails application not support Active record rails app used active resource API for featch data from another server , how i deploy the rails application to Heroku with no migration , schema , database file app,
Bajirao Pheshwe
  • 504
  • 2
  • 10
0
votes
1 answer

Rails Active Resource with sunspot solr

Hello i"m trying to implement an app which draws its contents via Active Resource, but i'd like to be able to search these contents. is it possible to use sunspot solr with active resource?
bbuegler
  • 13
  • 3
0
votes
1 answer

Rails devise let user sign in on one rails app by checking the users credentials on a second rails app

i have the problem that i have on rails app that stores all the user data and uses devise. What i'd like to do is create a second app lets the user sign in and sign out and are authenticated on the frist app. In the end i'd like my users on the the…
bbuegler
  • 13
  • 3
0
votes
0 answers

Calling REST API in rails using active resources

I am trying to fetch data from rest api through browser query ""http://abc.com:5555/v1/notifier/base/foo/2013-06-09T20:30Z"" works fine and returns a JSON blob. in my models/test.class i have class foo::base < ActiveResource::Base class << self …
sorabh
  • 297
  • 1
  • 3
  • 11
0
votes
2 answers

How can I split a where with OR's onto more lines?

I am trying to implement a search function searching through all the fields in a model to find matching records. I would like to split my where query at the OR's onto different lines. How can I do this? This is a working example: u =…
Pangolin
  • 7,284
  • 8
  • 53
  • 67
0
votes
1 answer

Consuming a rest API in rails 3.2.13

I have two rails apps running on different ports. From one app I am trying to consume the API of the other app. Here's the code for Product.rb model in APP_1. class Product < ActiveResource::Base self.site = "https://localhost:3000" …
user2122528
  • 71
  • 1
  • 4
0
votes
1 answer

Rails 3 ActiveResource not escaping unicode in xml when sending request

We recently moved to rails 3.2.13. We use ActiveResource to call a web service. ActiveResoure will generate the xml payload. We noticed that the new xml doesn't escape unicode character. For example: <name> C:\Documents and Settings\All…
DrChanimal
  • 681
  • 5
  • 10
0
votes
1 answer

Extending ActiveResource Class

Is it possible to extend an ActiveResource class unmarshalled from a response? Example of ActiveResource request: GET http://www.exampleservice.com/products.json Response [{name:'Product X', price:14.5, features:[{name:'Soft'}, {name:'Green'},…
anka
  • 3,817
  • 1
  • 30
  • 36
0
votes
1 answer

ActiveResource error with "wrong constant name ENV.xxx"

I'm consuming a REST endpoint using ActiveResource which has Keys called among others ENV.OM_PRODUCER, ENV.UMS_PRODUCER. These appear to be causing an issue with my view, I'm getting errors such as: NameError in AppsController#index wrong constant…
snick
  • 15
  • 5
0
votes
0 answers

How to get the attempted url and header information?

I'm trying to connect to a web service endpoint, and I can't figure out how to debug this, my code is: require 'rubygems' require 'active_resource' class Project < ActiveResource::Base class << self attr_accessor :auth_token end def…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
0
votes
1 answer

What are the basic assumed endpoints with ActiveResource?

I have a java backed web service that i want to test out with ActiveResource. What are the base assumed url endpoints, say I have a resource for Users. Currently my url is: localhost:8080/api/users I created a test class, and it fails because it…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
0
votes
1 answer

Rails, has_and_belongs_to_many, :HashWithIndifferentAccess error

On my server, I have two models: Broadcast class Broadcast < ActiveRecord::Base validates_presence_of :content belongs_to :user has_and_belongs_to_many :feeds attr_accessible :content, :feeds, :feeds_attributes end Feed class Feed <…
0
votes
1 answer

Rails 3 Consuming 'Non Standard' REST API

I need to interface with an api which seems to be not playing well with ActiveResource. What's the best/easiest way to consume it? I need to do a variety of read/write actions with the api including dealing with some relatively simple…
significance
  • 4,797
  • 8
  • 38
  • 57
1 2 3
23
24