About
Buy my book
Exceptional Ruby is the definitive guide to exceptions and failure handling in Ruby.
Pages
Categories
Tag Archives: rails
Early access beta of “Objects on Rails” Now Available
Often, at conferences and users group meetings, I find myself discussing the intersection of Ruby on Rails, Object-Oriented development, and Test-Driven Development, and I’ll mention something like “I prefer to develop my business objects first, and add ActiveRecord in later”. This usually leads to … Continue reading
DRYing up your validations using DB reflection
Avoiding silent truncation of your model fields requires putting length validations on them. But this can introduce duplication of knowledge. In this post I demonstrate how to pull limit information directly from the DB into your model validations. Continue reading
View Sandboxes for Rails
Designing HTML views is an iterative, interactive process by nature. And anything that slows down the iterations, slows down development. I was working on a form recently where the steps to show it went something like this: Go to the … Continue reading
RailsConf, BohConf, DCRUG Video
DCRUG First off, I had a great time at DCRUG last night. I enjoyed getting a peek at Jeff Casimir‘s “pre-alpha” presentation on Rails views. And Joel Strait‘s live demo of BEATS was very cool. I did something a little … Continue reading
Linkdump #7
Hacker Chat: Pinboard Creator Maciej Ceglowski Talks About Why Boring Architecture is Good, and More Wise words. tags: development I think many developers (myself included) are easily seduced by new technology and are willing to burn a lot of time … Continue reading
Posted in Links
Tagged architecture, bdd, java, javascript, literate programming, logging, nodejs, rails, rspec, ruby, tdd, testing
Leave a comment
Getting Started with Erector in Rails 3
Click to Play A quick guide to getting up and running with the Erector templating library. EDIT: Here’s the fork and branch I used to get it working.
Linkdump #6
agile/db_branch – GitHub I’d been looking for a way to manage databases for multiple branches of an app, and this is one of the (many) suggestions. tags: development database ruby rails git Rails plugin to play nice with git branching … Continue reading
Posted in Links
Tagged c++, c++0x, clojure, data structures, datamapper, javascript, links, memoization, parsing, rails, ruby, Ruby on Rails
Leave a comment
ActiveRecord association extensions and method_missing
The semantics of method calls in Ruby are simple: Call the named method; or If no method exists, call #method_missing() instead. Normally #send() obeys these rules as well. ActiveRecord association proxies mangle #send()‘s semantics, however, violating the POLS and potentially … Continue reading
Posted in Ruby
Tagged active, associations, extensions, method_missing, rails, ruby, send
12 Comments
Object Oriented Programming Comes to Rails
decent_exposure helps you program to an interface, rather than an implementation in your Rails controllers. Sharing state via instance variables in controllers promotes close coupling with views. decent_exposure gives you a declarative manner of exposing an interface to the state … Continue reading
Counters for Partials
Sometimes I like to number rows using a counter when rendering lists of things: <% @products.each_with_index do |product, i| %> <li class=”product_<%= i %>”><%= product.name %></li> <% end %> They are handy for testing, among other things. Of course, if … Continue reading
