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

Ruby Asana Gem - Get all tasks with particular tag

Im using the Ruby Asana gem https://github.com/rbright/asana. As per the documentation, in my controller I have: tag = Asana::Tag.find(6498432136675) @waiting_tasks = tag.tasks However, this returns: Failed. Response code = 400. Response message…
mike_eddie
  • 73
  • 1
  • 9
0
votes
2 answers

Need a create a simple app which accepts a json file and updates the database

I m very new to rails .I need a app which an accept post request with json and create a object in database .I know that we can do this with active resource ? I can not find any very tutorial .I no need any index ,show views .I just need to use a…
Arunachalam
  • 5,417
  • 20
  • 52
  • 80
0
votes
1 answer

Using has_many method in an ActiveResource object to relate to local ActiveRecord objects?

I want to use an ActiveResource object to map Users from a service but I have local data that I want to associate with these Users I have code that looks something like this: user.rb: class User < ActiveResource::Base self.site =…
aarona
  • 35,986
  • 41
  • 138
  • 186
0
votes
0 answers

Make a request to the current server

I have a rails application that includes some ActiveResource services. I try to run a server with this application and make a request from one service to another. Let's say I have an action in service1_controller.rb: def action1 …
benams
  • 4,308
  • 9
  • 32
  • 74
0
votes
1 answer

Security in rails Active resources

How to use cryptography with XML documents used for rails Active resources? Or, is there any way to garantee security and integrity with comunications through rails Active resources?
Lucas
  • 3,059
  • 5
  • 33
  • 48
0
votes
1 answer

How do I duplicate ActiveResource::Error object?

I'm performing an operation on a base_user. I want my @user's errors to be the same as the base_user's because I end up showing those errors as a banner in the view. But, I don't know how to set the @user's errors. Here is what I'm doing: …
Jack
  • 5,264
  • 7
  • 34
  • 43
0
votes
1 answer

How to find Product Images depending on the Alt tag?

I have been able to set the Alt tag when uploading an image to a product, via an html form. images = params[:images] || nil if images images.each do |image| a = ShopifyAPI::Image.new a.prefix_options = {:product_id =>…
ckhatton
  • 1,359
  • 1
  • 14
  • 43
0
votes
2 answers

Can ActiveResource POST a create instead of PUTTing it when an id is specified?

I'm calling a rails app from another using ActiveResource. I need to supply the id of the new object to the first app (yes, controller create in this app knows how to handle receiving an id), so I do something like this: a =…
diegogs
  • 2,036
  • 2
  • 16
  • 20
0
votes
1 answer

ActiveResource NameError calling a WCF Service

Lately I've been working on validating an architectural design idea using Rails ActiveResource as a client and a WCF restful service as a server. I have the WCF service running on Windows Vista in a bootcamp partition on a Macintosh hosted in VMWare…
Larry M
0
votes
3 answers

Why is resources in the routes.rb file not creating ALL of the routes?

I am making a rails application. After a user has registered (I have already created user registration with devise), they can fill out this form that will contain their profile information. The form should submit a post request to the create…
Philip7899
  • 4,599
  • 4
  • 55
  • 114
0
votes
1 answer

Alias attribute ruby ActiveResource::Base

class ChatMessage < ActiveResource::Base alias_attribute :user_id, :userId alias_attribute :chat_id, :chatId alias_attribute :message_text, :MessageText ... I Have the problem that what I return from an API has attribute names that I don't…
plotti
  • 137
  • 1
  • 9
0
votes
1 answer

actveresource thread safety under jruby

I have a rails 3.x app that makes heavy use of remote apis using Active Resource. The api authentication data and urls called can change based on the users login. We want to deploy the app using jruby with config.threadsafe enabled to allow for…
d-coded
  • 413
  • 3
  • 9
0
votes
1 answer

ActiveResource client not behaving as expected

I have this code: require 'rubygems' require 'activeresource' ActiveResource::Base.logger = Logger.new("#{File.dirname(__FILE__)}/exercises.log") class Exercise < ActiveResource::Base self.site = "http://localhost" exercises =…
blogofsongs
  • 2,527
  • 4
  • 21
  • 26
0
votes
2 answers

rails own resources controller and form for error

I have database table store model name models/store/store.rb class Store::Store < ActiveRecord::Base ... end controller controllers/store/maintenance_controller.rb class Store::MaintenanceController < ApplicationController def index @stores…
Muflix
  • 6,192
  • 17
  • 77
  • 153
0
votes
1 answer

Stubbing ActiveResource in development with Rails

We are currently in the process of splitting our monolithic rails app into multiple rails apps and are using ActiveResource to pull data from one app to another. In development this is a massive pain as we have to run two rails apps locally in…
dnatoli
  • 6,972
  • 9
  • 57
  • 96