Recent Posts
The Hitchhiker’s Guide to Ruby On Rails Galaxy
Return To Blog Listing
My tech blog Web Development using Ruby On Rails
Recent Posts Tagged With 'programming'
Using ERB as a dynamic template to create a file whose contents are dynamic
The following code will create a temporary file for say attaching a vcard file to email.The following code is dynamic to use ERB as a template to create the file dynamically every time with the variable “telephone”,”location”,...
To make text in TextArea selectable onclick of mouse
I am very sure most know about this and is a very simple thing. But as I have found sometimes that small things are the one which are missed. So wanted a quick note on - How to make the text inside a textarea selectable on mouse click. Well, we use t...
How to determine whether a request was Ajax or not?
This is something I wanted to remind self also: Never do the following: if request.xhr? render(:update) { |page| … } else redirect_to(…) end And instead do the following: respond_to do |format| format.html { redirect_t...
Sanity testing your code
This is a very simple way of testing your code or hypothesis, but lot of people don’t do it and end up wasting lot of time on exhaustive round of bug testing. According to Wikipedia: A sanity test or sanity check is a basic test to quickly eval...
