Rails: Avoid multiple level nested resource routes

While generating RESTful routes in rails, it is easy to get carried away and generate many levels of nested resources for every level of has_many associations. For instance, I recently wrote something like this in my routes file:
# in config/routes.rb
map.resources :first_resources do |first|
first.resources :second_resources do |second|
[...]

Rails: Thinking Sphinx plugin for search

Just a couple of weeks into being a rails developer, I made the one really, really, really big blunder — I used a find_by_sql in a search page. (Oh, please… stop booing. I was a newbie then.) Now, I’ve realized that I might have to modify the search to add yet another column, and well… [...]

How to create a simple datepicker using jQuery

jQuery allows you to easily create a datepicker and customize it according to your requirements. Here’s a quick look at how you can get started with using the jQuery datepicker.
The jQuery website has a nice application called Themeroller that lets you customize the interface for jQuery UI widgets. There are also plenty of themes available [...]