Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8113157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:44:17+00:00 2026-06-06T02:44:17+00:00

As a preface to this question: I am brand new to Rails development (and

  • 0

As a preface to this question: I am brand new to Rails development (and web-development in general), and some of my concerns may be unfounded, so any feedback would be very helpful.

I am attempting to make a Rails application that plugs into a RESTful API. I have been trying to determine the best way to go about this, and from what I understand, its narrowed down to making my own model from the ground up, utilizing ActiveModel, or utilizing ActiveResource.

It is unclear to me the advantages/disadvantages of each, and to be frank, I do not yet fully understand the difference between ActiveModel and ActiveResource. Can somebody provide me with insight regarding these three options and what makes the most ‘sense’ in a ror context? Thanks!

The best answer wouldn’t just say “Use ActiveModel”, or “Use ActiveResource” with instructions on doing so, however that would be helpful as well. I would really appreciate an answer explaining why I should use that thing, etc.

A few constraints I am dealing with are that I need to be using a key when I call the API, and a good number of the API calls will contain additional parameters.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T02:44:19+00:00Added an answer on June 6, 2026 at 2:44 am

    So the key to choosing which package to use here is whether:

    1. You are RETRIEVING data from the web API and want to
      store/manipulate on YOUR server, or
    2. You are MANIPULATING data via the web API and don’t intend on storing anything on your server.

    If #1, you’ll need ActiveRecord, as it’s Rails’ package for manipulation and storage of data on your Postgres/MySQL/etc database.

    If #2, you can use ActiveResource exclusively, which will let you retrieve data from the web API, work with it at runtime, and then make changes by posting back to the web API.

    Many applications though, will often use both of these packages. ActiveResource to grab data very easily, and then applying it to ActiveRecord models (like User, or Location, etc) which you can use locally without having to grab data from the API over and over again.

    To give you an example, for a service I was working on I grabbed Geolocation data from a public source (looking up coordinates for zipcodes), I then saved that data to local Location objects using ActiveRecord so I could look them up repeatedly without the delay of the Web API call. (if you’re smart, you’ll refresh this data from the web API from time to time)

    Determining whether ActiveResource will work for you

    Do the service requests conform to the documentation protocol? Look at the Expects a response of block in the Find method, for example. If so, you might be good to go without extra work.

    Note: The documentation is a little out of sync with the changelog — as of Rails 3.1:

    The default format has been changed to JSON for all requests. If you want to continue to use XML you will need to set self.format = :xml in the class. eg.

    Also, ActiveResource has been removed entirely from the Rails 4.0 branch, so if you’re looking forward to starting a new rails application and want the latest and greatest, this isn’t an option at all — but all hope is not lost, there are plenty of gems that make interacting with RESTful interfaces simpler, like Faraday (full disclosure: I have not used faraday myself so can really comment on its efficacy, but I located it here, and there are a number of other options.

    Note (from the same link above): Active Resource is built on a standard XML format for requesting and submitting resources over HTTP. It mirrors the RESTful routing built into Action Controller but will also work with any other REST service that properly implements the protocol. REST uses HTTP, but unlike “typical” web applications, it makes use of all the verbs available in the HTTP specification.

    If the answer to the above is no (it does not conform) you’ll need to write a wrapper class, see Facebooker for an example of how this is done in an actively maintained gem.

    References:
    Great tutorial on ActiveResource

    Getting started with ActiveRecord

    Keep in mind if you’re just starting web development, you’ll need to understand database and model basics too — you have your work cut out for you. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I should preface this question by saying that I am new to JavaServer Pages.
Ok, let me preface this question with the fact that I am extremely new
To preface this question: I've never actually done iPhone development. Haven't even downloaded the
First let me preface this question by saying that I'm fairly new to Javascript.
Let me preface this question with saying that I am very new to Orchard
Ok this may be a silly question for many of you. Let me preface
Please let me preface this question with an apology. I am very new to
I want to preface this question by stating that I am fairly new to
Let me preface this question with first stating that I'm new to GUI interfaces:
Let me preface this question by saying there may be a completely different solution

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.