blog

CMYK format images not displaying properly in IE 7

I am using paperclip plugin in my application for  uploading images. But when I am uploading CMYK format image  then this format image not displaying in IE7 properly. after some search I got the following solution and it's working. have added one line code in "paperclip" pluginn. Go to the  -  "vendor\plugins\paperclip\lib\paperclip\thumbnail.rb" On line no.64 … Continue reading CMYK format images not displaying properly in IE 7

Overriding to_s method for BigDecimal instance

requirement was to display decimal numbers which are having scale values present to be displayed in decimal format otherwise display them as integer. Output expected 12.23 => 12.23 12.00 => 12 While rendering any object on html page by default "to_s" method gets executed.So, i overwrote "to_s" method of BigDecimal class as below. Anyone having … Continue reading Overriding to_s method for BigDecimal instance

Uploading multiple files with nginx upload module and upload progress bar

Uploading files 'efficiently' has also been a pain point in most apps. I finally got to experiment with: nginx upload module (http://www.grid.net.ru/nginx/upload.en.html) nginx upload progress module http://wiki.nginx.org/NginxHttpUploadProgressModule) and upload multiple files via paperclip. There are resources available for handing these individually but not together. I used references from here and here. It is advisable to … Continue reading Uploading multiple files with nginx upload module and upload progress bar