Monthly Archives: March 2011

Setting up nginx maximum upload size

>Edit nginx configuration and look for html block.Inside html block add following line.http { include conf/mime.types; default_type application/octet-stream; client_max_body_size 10m; ….}In above configuration “application/octet-stream” supports any kind of file upload.

Posted in Ruby | Tagged | Leave a comment

What I like about Rails3

This is NOT a post about differences between Rails 2.x and Rails 3 but these are some musings about what I love in Rails. A lot of goodies come ‘in the box’ (I hate saying out-of-the-box) with Rails3 and some … Continue reading

Posted in Ruby on Rails | Tagged , , , , | 3 Comments

Twitter share and facebook like button for haml-rails, html/erb

>Twitter share and facebook like button for html/erb<div class=’spread’>  <div class=’twshare left’>   <a href=”http://twitter.com/share&#8221; class=”twitter-share-button” data-count=”horizontal” data-via=”funonrails”>Tweet</a><script type=”text/javascript” src=”http://platform.twitter.com/widgets.js”></script&gt;  </div>  <script src=”http://connect.facebook.net/en_US/all.js#xfbml=1″></script><fb:like href=”” layout=”button_count” show_faces=”false” width=”450″ font=””></fb:like></div>Twitter share and facebook like button for haml.spread .twshare.left %a.twitter-share-button.left{“data-count” => “horizontal”, “data-via” … Continue reading

Posted in Ruby on Rails | Tagged , , | 4 Comments

number to indian currency helper for rails with WebRupee

>rails has built in number_to_currency helper which takes options like unit, delimeter, seperator which displays foreign currency correctly but somehow it is not best suited for indian currency.Below is how we managed 2 years ago to display indian currency formatted … Continue reading

Posted in Ruby on Rails | Tagged | Leave a comment

Accessing View Helpers & Routes in Rails Console, Rake Tasks and Mailers

> While looking for accessing rails template tags to be accessed on rails console in order to examine whatever written needs to be correct, found that – rails template tags can be tested on rails console using helper objectmodule ApplicationHelper … Continue reading

Posted in Ruby on Rails | 2 Comments

Monitor Delayed Job in rails

>Delayed Job & Monit configuration We were struggling through how to monit delayed_job from past few months because monit doesn’t work seamlessly with delayed_job start/stop commands and finally we got able to monit delayed_job. Here is our old configuration that … Continue reading

Posted in Ruby, Ruby on Rails | Tagged | 4 Comments

Getting started with rails 3 & postgres database

>Rails 3 Installationsudo gem install rails -v3.0.4postgres as db installationbr/$ sudo apt-get install postgresqlRails 3 App with postgres as database$ rails new pg -d postgresbundle installationIt will install dependency gems & postgres adapter for db connectionbundle installHere by default ‘postgres’ … Continue reading

Posted in Ruby on Rails | Tagged , | 1 Comment