I am a web developer working with
SlideShare, Delhi. This is my Website.

Dynamic is_ ? methods for boolean attributes of a model

08.24.10 Posted in Blog by admin

A very common pattern observed in Rails models is a series of “is_{attribute}?” instance methods. Here, ‘attribute’ is usually a boolean column. I got tired of defining these similar methods. And adding to the misery, if the model structure changes to add another boolean field, you need to define another clone of the same method! [...]


Ruby on Rails views : Time ago in words for string time

07.27.10 Posted in Blog by admin

I worked my way around an interesting information tidbit discovery yesterday. The use case seemed pretty simple and direct. I needed to display the “n hours ago” text in my view. I used the awesome view helper ‘time_ago_in_words’ to do that and it worked, well almost. Here’s what I’m talking about: In console, time_string = [...]


ActiveRecord Object to Hash assignment in Ruby on Rails

07.13.10 Posted in Blog by admin

I find a frequent scenario in Ruby on Rails code base. A local hash variable is assigned a partial subset of an ActiveRecord object, or worse the variable gets the entire AR object. And may be you don’t already do it the way I have seen it, but its still worth discussing, being as frequent [...]


YAML Oddity for Ruby arrays

07.02.10 Posted in Blog by admin

I discovered this interesting nugget of oddity today. While normal Ruby arrays are ‘comma separated” and space agnostic ie. >> array = [2,3 ,4, 5] => [2, 3, 4, 5] >> array.size => 4 >> array_spaces = [2 , 3 , 4 , 5] => [2, 3, 4, 5] >> array_spaces.size => 4 In case [...]


Ruby on Rails Must follow RSS feeds

05.20.10 Posted in Blog by admin

Ruby on Rails community is fast growing. Too much is happening, and too fast. Its important to keep ourselves abreast of the latest in our community. Following are some RSS feeds I follow religiously [ well, I try]. So configure your favorite Reader and put on your reading caps: Always begin by looking at RoR [...]


Databases don’t bite!

02.19.10 Posted in Blog by admin

Checkout my post at Sapna Blog. http://sappsdreams.wordpress.com/2010/02/19/databases-dont-bite/


SpotMyHotel

08.02.09 Posted in Portfolio by admin

A mobile platform application to provide details ( including name, address and phone numbers) of hotels and food joints situated within the area selected by the user. The application is designed to fetch the required data from the backend web interface and parse it suitably to display results to the user in a pre-defined format. [...]


photoGenie

08.02.09 Posted in Portfolio by admin

Photo Genie is an attractive web portal that enables users to order pencil sketches, oil paintings, color paintings and pencil drawings created from the photographs that they can send through email or post. The website displays some sample transformation works through an attractive Javascript image gallery. The users can drop in and view comments from [...]


Canvass

08.02.09 Posted in Portfolio by admin

Canvass is an interactive web portal that enables users to register and create an account for image sharing. The registered users can upload images they would like other users to see, browse images uploaded by others, search images based on keywords and view a comprehensive list of their own files. An attractive Javascript image gallery [...]


ShareSend

08.02.09 Posted in Portfolio by admin

This is an online file sharing application which gives the user unlimited storage space using the cloud storage provided by integrating Amazon S3 service along with this. This application also includes the PayPal payment gateway to make secure payments between the user and the service provider. This was developed on Ruby on Rails which makes [...]