3 posts in total


Posts tagged

Highlighting current link within a navigation list in rails

1 min read

It's very common to want to highlight the current link within a navigation list for the current action being performed. If you are using Ajax, then this is easy, handle the onclick event to highlight the current link. Make sure you have a CSS class called youarehere. The followi ...

Adding close link to flash messages

by Syed Aslam · 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 · 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 ...