Archive for December, 2007

Rails 2.0.2 was tagged not too long ago and will hit the gem servers soon I expect. Being a minor point release there aren’t many changes, but here’re the ones I feel are worth mentioning: ActionPack changes Configurable asset hosts: You can now pass a proc to ActionController::Base.asset_host. This allows you to get by the [...]

Doing GROUP BYs in ActiveRecord has always been tricky. There’s a lot of “magic” in ActiveRecord and room for untested edge cases. Thankfully, Rails also has a squadron of eagle-eyed contributors who are on hand to fix unforeseen errors. For example, if you wanted to do this: class Click < ActiveRecord::Base belongs_to :site # site_id [...]

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 blog post may have been written a long time back but it’s still applicable to Rails 2.0. [...]

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), then it becomes tricky to say for sure which method is better, but I digress. There’re a [...]

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 only I didn’t have to mess with those URL params! Well, Deepak Jois from singapore.rb (the local [...]