Syed Aslam

Thoughts, stories, and ideas.

Loading data from multiple files in Ruby using Hash

by Syed Aslam in Ruby · 2 min read

Lately, I have been working applications which require data from an external source to be loaded into the local database. One such application is Sydrea (in the making!), which requires the Drug information to be loaded. Drugs@FDA is freely downloadable compressed zip file which ...

Adding close link to flash messages

by Syed Aslam in Rails · 1 min read

The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create action that sets flash[:notice] = "Successfully crea ...

Connecting to multiple databases in a Rails app

by Syed Aslam in Rails · 2 min read

A traditional Rails application uses a single application. We interact with it by writing models that inherit from ActiveRecord::Base which translate connection details (from config/database.yml) via the method establish_connection. Its a spatial application where everything is c ...