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
1
vote
1 answer

A way to silence "warning: Object#type is deprecated; use Object#class"

I have an application that interacts with ActiveResource from a system I have no control of. It happens that the system sends me a JSON feed and one of the fields is called "type" and, everytime this model is serialized, I get this nasty exception.…
kolrie
  • 12,562
  • 14
  • 64
  • 98
1
vote
3 answers

Rails active_resource require JS to do delete by link_to?

When I use link_to :method=>:delete, what rails has generated is a javascript click, which is not nice if you do come across situation your client just have javascript disabled. That seems a bad idea to me. Any chance to get around this?
William Yeung
  • 10,368
  • 9
  • 36
  • 42
1
vote
0 answers

Rails 5: undefined method `instantiate_observers' for ActiveResource::Base:Class

I created a rails 5 project and I'm trying to import a gem I made. I get the following error when i run any rake tasks from the rails project: NoMethodError: undefined method `instantiate_observers' for ActiveResource::Base:Class The error is…
Ultimation
  • 1,059
  • 9
  • 18
1
vote
2 answers

How do I create a Rails 4 model that is a hybrid between local records and remote resources?

I'm working on a social movie app in Rails. I do not wish to start from scratch on a database of movie info, so I've found a free and community-maintained movie database called The Movie Database (TMDB). It has a good API and documentation. How…
1
vote
1 answer

Authentication with an Existing External API

I am building a Ruby on Rails (Rails - v4.2.3 & Ruby 2.2.2) App which consumes an existing REST API. The aforementioned API is written in PHP. I need help regarding how to manage the authentication? On searching through various forums I came…
1
vote
2 answers

Simple Search while using ActiveResource

I am trying to create a simple search feature and getting a wrong number of arguments (2 for 0..1) error. I've followed every simple search rails tutorial to see what I might be doing wrong and had no luck debugging. Also to note (which might be the…
mikeymurph77
  • 752
  • 1
  • 11
  • 28
1
vote
0 answers

Is it possible to request partial models with ActiveResource?

We have a suite of applications that make heavy use of ActiveResource to provide data across the system. We also override model#as_json a lot to provide additional 'readonly' data for use by the client. This additional data is provided on every…
maniacalrobot
  • 2,413
  • 2
  • 18
  • 20
1
vote
1 answer

ActiveResource toplevel constant issue; query path is different intermittently.

Currently I have the above mentioned issue. From my understanding, this is an on going issue with rails autoloading and how there are standards in namespacing the various class. Product which retrieve product/products without any scope. #…
1
vote
1 answer

param is missing or the value is empty when trying to update using active resource

I'm making one simple rails application with simple forms for crud operations and one rails api that will have models and do all crud operations with data from rails application. In application i'm using ActiveResource. Currently i'm having some…
1
vote
1 answer

Rails disable eager loading for specific model

I'm writing a Rails application with functionality that interfaces with a third-party API (streamsend) via ActiveResource. I'm using shopify's fork of ActiveResource for thread-safe operation because different users of my application will have their…
John Jensen
  • 422
  • 4
  • 20
1
vote
1 answer

Consume JSON - Shopify API response

I'm trying to work with what I think is a JSON response from Shopify. It looks like this: => #2156425793, …
ToddT
  • 3,084
  • 4
  • 39
  • 83
1
vote
0 answers

In Rails, how to copy some object between independent applications?

We have 2 independent applications. We want to copy certain tables from one of the apps to the other. The ID of the objects being copied needs to be the same between both the apps. Also only specific rows need to be copied between the apps. Update:…
akshat
  • 15,472
  • 8
  • 30
  • 29
1
vote
1 answer

Using ActiveResource POST to create an entry in another Rails application

There are 2 apps App1 and App2 and I am trying to create an entry into the items table of App2 from App1 using ActiveResource I want this to work: new_item = App2::Item.create(:property1 => "foo", :property2 => "bar") This is what I am doing: In…
Garfield
  • 1,247
  • 4
  • 15
  • 33
1
vote
1 answer

Handling Active Resource Error

I have a simple question, and I am sure there is a standard answer to it; just can't find it. I have an ActiveResource user model in my rails app. It points to another rails app where my actual user entity lives. Everything in my app works fine…
Priyank
  • 14,231
  • 18
  • 78
  • 107
1
vote
1 answer

Escape '@' in names

I use Rails 4.2.0 with ActiveResource to implement a webclient for server API. The problem I've faced is that server resources contains '@' and '@@' in attribute names. So these attributes can't be processed correctly by ActiveResource while…
wiseland
  • 1,010
  • 9
  • 16