Archive for the ‘Rails’ Category

Block magic for Rails helpers

Ever wondered how can you have something like this <% some_helper do %> Some text here <% end %> Well, here how it is… def some_helper(&block) content = capture(&block) concat(“this comes before the block”, block.binding) concat(content, block.binding) # adds “Some text here” to the view concat(“this comes after the block”, block.binding) end Neat! Isn’t it

Getting around the dreaded Operation Aborted error in Internet Explorer with Ruby on Rails

If you have ever experienced this… …you know how painful it is to debug and rectify. This error was so common that Microsoft created a knowledge base (KB927917) article for this. It even has a dedicated explanation at the IE Blog. The error basically is – “HTML Parsing Error: Unable to modify the parent container [...]

Learning from the best!

Just bought “Programming Ruby 1.9” from Flipkart. From For Blog When I joined IBM ISS UI team and my tech lead suggested that we should start doing things in Rails- and I was prompt enough to pop up a suggestion – “that why don’t we use Python based web app frameworks Django or Turbo Gears [...]

An IDE which suggests best code practices, shows a diff and lets you selectively apply…

Programmer Happiness – onroad to Rails3

Medium: www.vimeo.com Link: www.vimeo.com Rails 3 Update by Yehuda Katz from Wind City Rails 2009 You just can’t ignore his style of explaining things!

Authentication using Google Accounts for your Rails App

The methodology is very simple. Redirect the user to grant access to your app for a particular Google service. Once access is granted, use the authentication token to retrieve information related to the user. I demonstrate this with a very simple & idiotic Sinatra app which actually does nothing intelligent – apart from just outputting [...]

Location of Rubygems in Ubuntu Jaunty

With Jaunty, the location of installed gems has been moved to /var/lib/gems while it was /usr/lib/ruby in releases before. Please follow http://intertwingly.net/blog/2009/04/25/Rails-on-Jaunty for more on how to rectify the problem that might arise.

Super easy SUB-URI hosting with mod_rails

With an Amazon EC2 instance up, next very obvious task was to get the hosting up. Objective was to host static content along with multiple Rails apps on the same EC2 instance. Purists might not agree to this, but getting up and running was the first target. Apache is configured with DocumentRoot as /mnt/app/shared My [...]

Getting back to the drawing board…

Drawing boards are so much more fun than paper’n pencil

LITBox helper for Rails

Introducing – LITBox Helper for Rails! Disclaimer: This is a work in progress and is available on “as is” basis. For long, I was trying to integrate Criag Ambros’s RedBox plugin into ApnaBill.com project for implementing modal dialogs but somehow, the CSS always used to get upset, rendering the lightbox in such a way that [...]