A couple of months ago Bartosz described how we use Facebook to improve communication in our team. Actually most of the content on our wall are more or less interesting links from the internet. We quickly noticed a troubling pattern though—they are easy to forget. And if you forget them, you can’t use them.

So we decided that we’ll be regularly preparing a brief summary of the best content so it’s easy to find and convenient to browse. Our goal is not to provide The Hot News™—you can find them anywhere—but the top of the top stuff which we believe will remain valuable for a long time. So… let’s start!

JavaScript rules

Roy Tomeij, one of the speakers on the last wroc_love.rb conference, suggested that classes should be replaced with data-* attributes for JavaScript selectors. Recently he followed it up with some benchmarks and shared the numbers. If that doesn’t convince you, read why classes are for designers and data-behavior is for JavaScript developers.

If you have problems organizing your JavaScript assets when using Sprockets, you should read an awesome article from Unholy Rails: adding JavaScript to Rails.

Improve your tests

How to (and why) test factories—short and easy, but very useful protip from Thoughtbot.

If yours tests take too long, check if you can replace doubles with OpenStruct. Xavier Shay did some benchmarks on the subject.

There is new shiny tool on the horizon, Testacular, and I think it can soon replace Selenium. It allows to run tests in multiple browsers with your favorite testing engine under the hood.

If you don’t feel comfortable writing tests, there is a new site for you: betterspecs.org, the collection of bad examples turned to good. It’s open-sourced so you can always add a new example or fix another if you disagree with proposed solution.

Coding patterns

DCI is a hot topic these days, but there is still lack of good examples, especially in Rails context. 

Another interesting approach to DCI in Rails is shown on already mentioned Xavier Shay’s blog in article titled Dependecy Injection for Rails Controllers.

See you next time!