Blog posts for Ruby, Ruby on rails and Linux.

Installing sunspot solr in production for rails application
Kapil Raj Nakhwa2016-Jul- 3

In ruby on rails , The go to option for most of the developers is solr by sunspot.  https://github.com/sunspot/sunspot. They already do have an excellent readme and provide indepth instru...Read full article

Tags: ruby on rails,sunspot,solr,lucene,ruby,rails,search on ruby on rails

Getting Started with Null Object Pattern in Ruby
Kapil Raj Nakhwa2016-Jan-31

Often we have conditions when we as ruby programmers are hammered with whiny nil problems. We are hammered with exceptions where somewhere in the code some method is being called  on the nil o...Read full article

Tags: ruby,null,null object,design patterns,null object pattern,code smell,code,nil

Improve your work flow : auto cd paths in zsh
Kapil Raj Nakhwa2016-Jan-27

So thing is we developers want to improve our workflow and keep our repeating tasks to minimum daily so that we would are more efficient much like the code we write down . If you are like me you ar...Read full article

Tags: zsh,workflow,productivity,zen

Installing git, Rvm , ruby and ruby on rails on Mac OSX.
Kapil Raj Nakhwa2015-Jul-23

I know, I know , It is some basic stuff but recently I was asked by one of the starters to write about this so here we go. First things first. What we would like to install in our system is a nice ...Read full article

Tags: rvm,ruby on rails,git,mac,mac osx,osx,kapil raj nakhwa,homebrew,curl,wget

Dynamic sitemap for rails 4 application and integrate with capistrano.
Kapil Raj Nakhwa2014-Jan- 5

Adding Sitemaps to the rails 4 application is fairly easy and we might want to automate the process of updating the sitemap as much as possible along with submitting it to the major search engines....Read full article

Tags: rails4,seo,sitemap,capistrano

google analytics for rails 4 and turbolinks
Kapil Raj Nakhwa2013-Nov-11

Now we all know that google analytics is a great tool to gather key insight into our site and monitor our visitor behaviours which help in further planning and targeting of our site to achieve the ...Read full article

Tags: Rails-4,Turbolinks,google analytics

Combine two arrays into single and remove the duplicate with one single expression in ruby.
Kapil Raj Nakhwa2013-Nov- 1

Hi Guys, So There are many many times in a single day when you are working in ruby and you might need to perform operations in array. And you might also need to combine two arrays into a ...Read full article

Tags: ruby,arrays,combine,trick

User friendly urls with friendly_id gem in rails 4
Kapil Raj Nakhwa2013-Oct-23

Urls like http://www.example.com/products/1may be machine readable but these links do not make much sense to humans. Friendly id has been a great tool along the life time of rails 3 projects. So I ...Read full article

Tags: friendly_id,rails4,Turbolinks,urls,seo

Using Helper methods in the ActionMailer views
Kapil Raj Nakhwa2013-Oct-22

Many of the times we need to use some helpers inside our mailer views to show or format some information. But the helper methods are not available inside the ActionMailer Views By default. So what ...Read full article

Tags: rails4,helper methods,actionmailer,views,ruby-tricks

Enabling assets precompilation with capistrano
Kapil Raj Nakhwa2013-Oct-21

Hi , While deploying rails application with capistrano most of us are still confused about how to properly compile assets. and we try various ways such as changing the settings in the production.rb...Read full article

Tags: rails,capistrano,asset pipeline,precompile

Never miss a post on new ruby and rails tips