Articles

Rails 3 Beta is Out — A Retrospective

The Rails team has finally released the Rails 3 beta, after more than a year since the Rails and Merb teams started working on this release. You can read all about it at the official Rails blog, but I figured I’d take the opportunity to share my take on the release.

First of all, you’re probably sick of hearing this, but we’ve done far, far more than we ever expected. A lot of that happened in the last few weeks.

Active Record Query Interface 3.0

I’ve been working on revamping the Active Record query interface for the last few weeks ( while taking some time off in India from consulting work, before joining 37signals ), building on top of Emilio’s GSOC project of integrating ARel and ActiveRecord. So here’s an overview of how things are going to work in Rails 3.

Railscasts Xcode theme

For those of you who use the excellent Railscasts TextMate theme and want to replicate the theme in Xcode, you can grab my version from Github. This is what it looks like:

The Ruby Show 106: Making Up Words

In this episode, Dan and Jason have fun making up words and also report on the latest with MacRuby, Rails 3, and more.

Shopify & 100k contest in NYTimes

Article

Homebrew: OS X’s Missing Package Manager

Managing software packages on Unix has always been, to put it politely, a giant pain, and most Linux distributions are built around the different ways we’ve all been trying to alleviate that pain. In this post, I’ll walk you through Homebrew, a fantastic new option for package management made simple.

Multiple Domain Page Caching

The other day Brandon Wright emailed me about the following tweet:

Just deployed full page caching on Harmony. Our log file stopped spinning by which made me happy and sad.

Chapter 6 of the Ruby on Rails Tutorial book

A draft of Chapter 6 of the Ruby on Rails Tutorial book is out. Enjoy!

Screencast: How To Upgrade Your Rails 2 App to Rails 3 in 25 Minutes

Geoffrey Grosenbach (of PeepCode fame) has put together a FREE 25 minute screencast showing how he's converted a Rails 2.x app to Rails 3.0.

GitHub Drinkup, Paris Edition

As I’ll be speaking at the Symfony Live Conference in Paris in a few weeks, GitHub and Sensio Labs are co-hosting a GitHub meetup in Paris on Wednesday, February 17th at 8pm.

We’ll be joined by a bunch of PHP people from the Symfony Live Conference hopefully, so if you’re a GitHubber not going to that, please join us for some cross-language nerd chatter. I’m also giving a short Git talk at 8:30p if you want to see that.

We hope to see you there!

Articles | Rails Fire

Articles

Create fixed thumbnail using attachment_fu . Example with live pictures included

If you are in a hurry then take a look at following four links

Thumbnails with Rmagick for a normal picture

Thumbnails with Rmagick for a tiny picture

Thumbnails with MiniMagick for a normal picture

Hirb: An Easy-to-Use View Framework for irb

hirb The Interactive Ruby Shell (irb) and the Rails console are great for interacting and experimenting with your ruby application code, but sometimes it's hard to visualize the output. Gabriel Horner has come to the rescue with H

Understand Named_scope in 60 seconds

Named scope was introduced in Rails 2.x, it allows you to filter a selection of records easily and repeatedly, without having to write finder SQL all the time.

class Customer < ActiveRecord::Base
has_many :carts
end

class Cart < ActiveRecord::Base
belongs_to :customer
named_scope :completed, :conditions => ["NOT ISNULL(completed_at)"]
end

Example of self-model scoping and finding:

# All completed carts [...]

Paged Scopes, Part III: Paginating Your Views

In my two previous articles, I’ve been describing my new Paged Scopes pagination gem for ActiveRecord and Rails. In this final installment I’ll describe how to use the library to render pagination links in your views.

Paged Scopes, Part II: Routing and Controller Methods

Last week I described the basics of my Paged Scopes rubygem for ActiveRecord. In this article I’ll describe some routing and controller methods that make Paged Scope pagination very easy to use in your Rails controllers.

Paged Scopes: A Will_paginate Alternative

The first time I needed to paginate data in a Rails site, I went straight for the de-facto standard, which, since Rails 2.0, has undoubtedly been will_paginate. However, it didn’t take me long to discover it couldn’t do all that I wanted it to.

Talk: Rails I18n From The Trenches, Clemens Kofler

Summary

This talk aims to provide novice and advanced users of Rails i18n with valuable information on how to tackle translating and maintaining an internationalized and localized Rails application. The talk will give an insight into existing structures and techniques in Rails i18n and an overview of existing plugins and tools as well as an outlook on potential future developments.

Talk: The Ruby Guide to *nix Plumbing, Eleanor McHugh

Summary

A lightning tour of writing multi-process Ruby applications in the *nix environment with nothing more than a vanilla Ruby runtime and a knowledge of system call numbers.

Talk: The Invoiving Gem. Sales &amp; payments in your app, Martin Kleppmann

Summary

You have an awesome app, and your users are willing to pay you to use it?
There is still a barrier between you and the money: accounting, tax, payment
processing, maybe special discounts, reseller deals and more... Martin will
show how to overcome the boring financial stuff quickly using open source
tools, while leaving you with the flexibility you need to scale the business
in future.

Modeling entity relationships in a non-relational scenario

Since we have been using I18n in Partigi for the last months we have notice that we were always repeating ourselves when localising a sentence like this:

This film has been saved by 4 friends

What is special in this sentece is that, depending on the number of friends that saved the film, the sentence could be "This film has been saved by one friend". It can be solved with pluralize helper, but it requires the counter to be at the beginning of the sentence.

BucketWise: Preview #2 | Rails Fire

BucketWise: Preview #2

“Buckets” is now “BucketWise”. The name was more unique, easier to identify as an application, and just felt better than “Buckets”.

To celebrate the new name, I’ve also made another screencast, this one demonstrating BucketWise’s anti-debt features. It’s a bit more long-winded than the first one: five and a half minutes of me talk-talk-talking:

BucketWise Preview #2 (QuickTime, 5:30, 10MB)

I’m slowly working my way through the list of things that I want done before I release the code. For the curious, here’s what I’m wanting done before I open it up:

Existing bugs:

  • after saving a reallocation event, the line items don’t reset
  • green “your transaction has been recorded” notice doesn’t disappear when starting a new event
  • date column for event row is squashed in safari
  • “Add a new bucket” should set focus on new bucket line
  • check number and “select repayment options” links are out of whack when editing an event
  • deleting event from account perma results in ajax error (maybe only when there is only a single event in the account?)
  • Reallocating a bucket doesn’t change the updated_at field for the bucket?
  • “move in” and “move out” links on dashboard don’t use existing form—they go to events/new
  • make all autocompleting fields refresh their source array after event creation

Remaining features:

  • tag delete (optionally move transactions to different tag, e.g. “tag merge”)
  • tag rename
  • API
  • validations
  • rake tasks for user and subscription creation
  • change style for event detail view: “window shade” style isn’t really working
  • attr_protected everywhere (perhaps implement an update_override method or something for places where it would be useful to do mass updates despite protected attrs?)
  • spinner for ajax actions
  • user info page (for password change)
  • password reset from login page
  • cache balances on events (?)
  • README with installation instructions
  • CHANGELOG

Those lists are straight from my TODO file. But for those who think I’m waiting for too much to be finished, never fear. I’ve got plenty that I want to implement, but which I’m willing to wait until post-release to work on:

  • signup process
  • exception notifier (?)
  • /subscriptions index
  • autocomplete actor field in event form
  • better 404 and 500 error pages
  • searching & reporting
  • account reconciliation
  • transaction templates (“saved” or “memorized” transactions)
  • scheduled transactions (occur automatically at specified intervals)
  • show check numbers in event detail view
  • add a memo field for events
  • print stylesheet
  • oauth authentication for API
  • filter event views to show only events with a non-zero balance for the account in question
  • filter event views to show only deposits, or only expenses
  • normalize ‘actor’ so we can do actor-centric queries more efficiently
  • full-text searching on the memo field
  • show bucket and account balances next to names in drop-downs
  • make bucket reallocation work from bucket perma

Depending on how soon my bank sends the next statement for my checking account, I may or may not need to have “account reconciliation” done before launch, too.

As before, let me state: I’m writing this application for myself, and really only for myself. If other people like it, that’s cool. I’m more than happy to share and let other people hack on it. I may even release it into the public domain (I haven’t yet decided what license I’ll use). But BucketWise will always be very opinionated. If you prefer having your finance app download your transactions from your bank, you’ll be disappointed by BucketWise. If you need currencies other than the US dollar, you’ll be disappointed by BucketWise. If you need pretty charts and graphs to analyze your cash flow, or if you want to track investments, or any number of other things, you’ll be disappointed by BucketWise.

Just FYI. :)