Records
Newest first
-
071
ActiveRecord::Base.with_scope { :only => 'in your model' } - Rails 2.0 a feature a day #4
Today's (un)feature covers the oft-abused and misunderstood with_scope method. The excellent err.the_blog had a post on how you should be using with_scope (yes, only use it in your ActiveRecord models, not in your controllers or filters). Yes that…
Ruby on Rails
-
072
Concatenate your stylesheets and JavaScripts in 3 seconds - Rails 2.0 a feature a day #3
I don't think I need to explain how concatenating your 5 stylesheets and 12 JavaScript files into single files each makes your webpages load faster. Unless you're using multiple asset hosts (Rails 2 allows for multiple asset hosts),…
Ruby on Rails · Web development
-
073
gchartrb = Ruby + Google Chart API
Google Chart API looks quite useful. I've used Gruff to generate graphs before but this looks way easier (and much lighter on the server without all that ImageMagick magic!) I'll have to play with it someday - if…
Open Source · Ruby
-
074
Declarative exception-handling in your controllers - Rails 2.0 a feature a day #2
I know I said I was going to try and keep the features in "a feature a day" to those not mentioned in popular places, but this feature is one of the few nicest features in Rails made…
General
-
075
Time#advance now uses :weeks, :hours, :minutes, :seconds options - Rails 2.0 a feature a day #1
Time#advance and DateTime#advance just got, erm, more betterer in Rails 2.0.
In Rails 1.2.6 and earlier, Time#advance and DateTime#advance only accepted :year, :month and :day options. You'd think :hours, :minutes and :seconds would work too but due to a…
General