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 1084031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:30:37+00:00 2026-05-16T22:30:37+00:00

I starting to investigate whether Ruby-on-Rails will help solve my problem in some way?

  • 0

I starting to investigate whether Ruby-on-Rails will help solve my problem in some way?

In short, I have a legacy application which is reading and writing a collection of images. This application also uses a sqlite database to help refer to correct image files when required.

What I’d like to do is have an iPhone and/or iPad application browse the images, but also be able to see updates and additional images without hitting a refresh button; or using a periodic timer say.

This brought me to investigate Ruby-on-Rails as a solution?

I made the following diagram to think about whether I’m on the right path:
isrubyonrailstheanswer
To date I obviously have the (legacy) in-place linux app, which generates images and updates the database. I have also embedded a bonjour service inside the linux app to allow an iPhone application to connect and to-date browse thumbnails that are inside the sqlite database. The tricky part is that I’ve realised that the iPhone app needed to be kicked to update its images when the database is changed remotely.

Actually I thought that with a ruby-on-rails app it could provide a RESTful service to access fullsize (plus, thumbnail) images allowing the thumbnail images to be removed from the sqlite database – it’s likely the database could have 10000+ entries, so didn’t want the db to grow unnecessarily.

Any tips or resources would be great.

Thanks.

Update: I had a think about the wording of my question again. I guess I was trying to figure out if I could get something like Rails to monitor changes to a database without polling in some way.

  • 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-05-16T22:30:38+00:00Added an answer on May 16, 2026 at 10:30 pm

    The simplest solutions I can think of is to have an action on your RESTful service which pulls the most recently modified date from the database. Periodically query this from your iPhone app, and then refresh the list.

    For example, if you create scaffolding for images:

    rails generate scaffold Image name:string filename:string # fill in the other attributes you need
    

    NOTE: You will have to sync your legacy DB to this Rails table

    Then each image object is automatically created with an “updated_at” attribute.

    class ImagesController < ApplicationController
      # GET /images
      # GET /images.xml
      def index
        @images = Image.all
    
        respond_to do |format|
          format.html # index.html.erb
          format.xml  { render :xml => @images }
        end
      end
    
      # GET /images/1
      # GET /images/1.xml
      def show
        @image = Image.find(params[:id])
    
        respond_to do |format|
          format.html # show.html.erb
          format.xml  { render :xml => @image }
        end
      end
    
      def newest
        @image = Image.find(:last, :order => :updated_at)
        respond_to do |format|
          format.html # show.html.erb
          format.xml  { render :xml => @image }
        end
      end
    
      # more methods down here
    end
    

    and you’ll have to add the following match line to your routes.rb

    YourAppName::Application.routes.draw do
      match 'images/newest' => 'images#newest'
      resources :images
    end
    

    Now, from the iPhone app you can pull an XML file describing your most recent image with this URL

    http://localhost:3000/images/newest.xml
    

    Parse out the most recently updated time, and compare it to your last refresh date.

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

Sidebar

Related Questions

No related questions found

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.