Rails Best Practices

Bob Roberts:

A couple of these tricks I wasnt aware of like the find_each. Thanks for the write up ;)

Originally posted on Rails Best Practices:

With the fast pace of today’s agile development industries, we know how important it is to complete a project on time. We also recognize the importance of other factors such as flexibility and readability & most important performance of the application.

 Many times even experienced developers do not consider above points, which wont impact during initial stages of application, but will raise problems when the data in application grows exponentially and enhancement is to be done for existing application.

 Below are some best practices in Ruby on Rails, which should be considered at time of development in Rails framework.

 * Use Eager Loading (Prevent N + 1 queries)

 Most of the time new Rails developer not use eager loading of object in Rails.

 Eager Loading is highly recommended at the time of development in Rails.

It mainly resolved the common issues like N + 1 queries.

We can detect the N…

View original 1,165 more words

Leave a comment

Posted by on September 11, 2014 in Ruby on Rails


From Capistrano 2.x to 3.x

Bob Roberts:

I have been putting off on upgrading Capy. There were a lot of changes between 2 and 3. I will have to try this out (if I get brave enough!!)

Originally posted on Silicon 9 East:

This guide describes upgrading from capistrano version 2.x to 3.x. In our company we use capistrano to deploy rails 3 & 4 applications on test- and production-server. Our servers run with apache and passenger gems apache module.

Why Upgrading To Capistrano 3.x

Well it is some work and you need to change a lot, this is true. The following reasons nevertheless convinced me to dive into this adventure:

  • Cap 3 has out of the box multistage support
  • As far as I know cap 2 support has ended. Last cap 2 gem update was 4. July 2013. The documentation of cap 2 (see) is referred to as “legacy” documentation.
  • Cap 3 has a cleaner, more intuitive config file content structure and uses a news simpler DSL.

Let’s Upgrade!

Now that I have your attention and hopefully have convinced you that upgrading to cap 3 is totally worth your time and effort…

View original 727 more words

Leave a comment

Posted by on September 3, 2014 in Ruby on Rails


RailsBridge Phoenix – Ruby on Rails for Women

OK, everybody, it is time for us to give back to the Ruby/Rails community that has made many of us a enjoyable and profitable life….

We at Socialwhirled have decided to sponsor and host a RailsBridge event in Phoenix ( the 19th and 20th of September.

From their site:

We teach people to code because we believe that the people making technology should accurately reflect the diversity of those using it.

We want to push for all kinds of diversity in tech: gender, race, sexual orientation, ability, and class. Women were the first population we focused on, but aren’t the last.

We value acceptance, enthusiasm, and hard work. The RailsBridge community thrives on optimism and a love for making great things.

What’s a RailsBridge Workshop?

Our most well-known efforts are free weekend workshops where women learn Ruby on Rails from volunteers. The students at our workshops range from folks who are completely new to programming to QA engineers and professional developers who want to learn Rails. During the Installfest (usually on a Friday evening), we get students’ laptops setup with the requisite technologies. The next day, we break into small group based on experience level and build a web app! (When we aren’t teaching Ruby and Rails, we teach HTML & CSS.)

Here is what we need:

Volunteers to assist in teaching as well as TA’ing.  I think we will need about 8 people that can teach a class using their curriculum and assistants to help attendees that are stuck.

Attendees to attend.  Spread the word to friends, strangers, social media, etc…

I will post the links as soon as I have them setup.  All social media should use the #railsbridge and #railsbridgeaz hashtags.

Most of us learned form others so lets return the favor.

Questions, comments, suggestions, want to volunteer, email me at

Leave a comment

Posted by on August 20, 2014 in Ruby on Rails


DRY Social Media Links

Bob Roberts:

Nice idea. You could go one step further and have the social_media as a variable in your controller.

Originally posted on PareidoliaX:

I went a little crazy with social media links last night. I wanted to make a nice nav element full of them. First I found a great github repository and site for the images called

With all those great icon options I ended up wanting to make nine links but I wanted to keep things DRY so I used an array and a loop. I was pretty pleased with the result.


This code is available…

View original 9 more words

Leave a comment

Posted by on August 20, 2014 in Ruby on Rails


The Well-Grounded Rubyist, 2nd Edition – A solid, well-written, updated guide to the Ruby programming language – #bookreview

Originally posted on Books, Books & More (New) Books:


The Well-Grounded Rubyist

David A. Black

(Manning -paperback)

Ruby, predominately known as an object-oriented programming language, shows up frequently on lists of the top ten (or whatever) languages to know. And Ruby has long been paired with Rails to create the popular Ruby on Rails web application framework.

When the forerunner of this book appeared eight years ago, it was titled Ruby for Rails: Ruby Techniques for Rails Developers. And R4R, as it is sometimes known, was well received in both the Ruby and Rails camps.

In 2009, the R4R book was revised and retitled The Well-Grounded Rubyist. “This new edition is  a descendant of R4R but not exactly an update. It’s more of a repurposing,” the author, David A. Black, noted at the time. “The Well-Grounded Rubyist is a ‘just Ruby’ book, and it’s written to be read by anyone interested in Ruby.”

That focus continues…

View original 249 more words

Leave a comment

Posted by on August 14, 2014 in Ruby on Rails


Amazon SES + Ruby on Rails

I really could have used this info a couple of months back when I starting working with the Amazon SES for the first time. Thanks for the post ;)

Leave a comment

Posted by on August 9, 2014 in Ruby on Rails


security in rails

Bob Roberts:

Great info here for securing Rails site. Did not know of sanitize but I am going to use it. Thanks :)

Originally posted on codedecoder:

Any thing on the net is vulnerable to attack. The threat can be at any layer: databaseweb server or web application. Some of the common security threat are : Cross Site Scripting (XSS), Cross Site Request Forgery (CSRF, XSRF), Man in the Middle (MITM)SQL Injection (SQLI)Mass Assignment & Parameter Injection etc . There is nothing like complete protection. There is a proverb in hindi “taala sarifon k liae hota hai…choron k liae nahi” , means “Lock on the door can prevent good peoples from entering the house not the thieves“. But at least the lock can make the thieve to struggle for entry and provide 60% security to our house.

Rails framework, provide 70% inbuilt security if you use all its feature properly and adhere to its security guideline . Web Security is a wide field in…

View original 2,055 more words

Leave a comment

Posted by on August 4, 2014 in Ruby on Rails