Tips Category

security check.png

14 Bare Minimum Security Checks Before Releasing a Rails App

When you upload your latest app to a production Web server and open it up to the world, you're really throwing your app to the elements - good and bad. If you don't pay any attention to security whatsoever, you're…

sanjuanoil.png

HOWTO: Unobtrusive JavaScript with Rails 3

This post is by Rizwan Reza. See footer for more info.

One of the big surprises and accomplishments is the fact that Unobtrusive Javascript made it into Rails 3. At first, we thought UJS wasn’t going to be included in Rails 3. Well,…

tickbox.png

The 15 Step Rails Code Quality Checklist

The Ruby on Rails Code Quality Checklist is a 15 point "quality checklist" for Rails developers to run against their Rails applications by Matthew Paul Moore. It's a year old, so predates Rails 2.2 and 2.3, but it recently made the…

oohmatron.png

20 Things That Suck About Other People's Rails Code

Chad Fowler surveyed his Twitter audience and came up with 20 Rails Development No-No's. It makes for entertaining reading.

In short, people hate:

  • Code in views
  • Bad tabbing / spacing indentation
  • Lack of tests
  • Misuse of Single Table Inheritance
  • Poor exception handling
  • Ruby idioms they don't understand
  • Rails idioms…
david-berube.jpg

Re-implementing acts_as_paranoid using default_scope in Rails 2.3

A few months ago Mike Gunderloy wrote 3 Plugins for Safer ActiveRecord Deletions for Rails Inside and mentioned acts_as_paranoid, a plugin that flags ActiveRecord objects as deleted without actually deleting them (this is useful if you might need to "undo" the…

Rails Templates Pumped Full of Caffeine

Rails 2.3 is not yet released but has become extremely popular to use already in its "edge" form. The official release will be available in the next couple of weeks (so I am told) and one of the most exciting…

New Edge Rails Feature: Default Scoping

In his "What's New in Edge Rails" series, Ryan Daigle has just written about "default scoping." You're probably familiar with regular named scopes on Rails models, but now there's a default_scope method that defines a scope that exists by default on find methods.

Example:

class…

Page Caching Enhancements

For anyone who's struggled at how to obtain the maximum performance in a Rails application on limited hardware- the good guys over at Rails Spikes have posted an informative article with some tips on implementing page caching in a Rails application…

200808021803.jpg

How to Detect and Fix Slow Rails Requests

Derek Haynes has written "4 Simple Steps to Detect & Fix Slow Rails Requests," an excellent guide to figuring out what's causing your Rails app to slow down, and what to do about it. The main argument is that Rails…

Rails 2.1 Caching Walkthrough

Rob Anderton has put together an easy-to-read walkthrough of some of the new caching features in Rails 2.1. One of the coolest new features is that Rails provides an abstraction to using the back-end caching features (whether ultimately provided by…