Deepak Dargade.

I'm a Mumbai-based Entrepreneur, Ruby on Rails monomaniac and Food enthusiast.
Best known for turning ideas into reality and Co-founder of Classpro.

Nginx - Redirect non www to www
07 Dec 2013

Nginx 301 redirect (non-www to www – traditional way)

Read more

Fixing MySQL’s Illegal Mix of Collations
14 Oct 2013

I recently started to encounter MySQL’s dreaded illegal-mix-of-collations error. The occasional query would result in Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ‘=’.

Read more

Enable binary log in Mysql
03 Jan 2013

To enable binary log in Mysql, edit the file:

Read more

Rails sends 0 byte files using send_file
30 Dec 2012

send_file has :x_sendfile param which defaults to true in Rails 3.

Read more

Rails 3 data attributes in select tag
05 Aug 2012

in Rails we can add custom attributes to select options, using the existing options_for_select helper.

Read more

Rails on Unicorn - Localhost
11 Apr 2012

Time for flying rainbow horses. Start by installing the Unicorn gem:

Read more

ActionMailer 3.2.0 Upgrade SSL Issue
06 Mar 2012

I upgraded my Rails app to Rails 3.2.0 from 3.1.3 and found that my SMTP outgoing mail was no longer able to authenticate with my mail server.

Read more

Position of callbacks is important in Rails Model
29 Feb 2012

Yesterday i was working on destroy action of a model in. Before deletion I had to check whether the model has any child model or not. Even the model has child model, but deletion was successful even though i had set to false.

Read more

Thought
11 Dec 2011
Maybe the best programmers aren’t those who spectacularly solve crazy problems,
but those who don’t create them, which is much more silent.
Read more

Ruby on Rails to_json with include
11 Dec 2011

If the models aren’t associated through active record, then fetching json data is pretty simple in Ruby on Rails.

respond_to do |format|
  format.json  { render :json => @order}
end
Read more

« Previous