Wolfram Arnold's blog
Nested Attributes and how much fun it is to give a talk with a live demo
Wolfram Arnold — Tue, 07/21/2009 - 23:29
Tonight, I presented at the East Bay Ruby Meetup on invitation of Jon Seidel, the host, a talk about a very cool new feature in Rails 2.3.
On Improper Gestures or How to Not Recruit Rails Developers
Wolfram Arnold — Fri, 06/26/2009 - 22:15
When we decided to hire to some help for the design and copy writing on our web site, I was particularly pleased with the hunting references Anita came up with for our recruitment services at RubyFocus. What does it take to hire a Rails Developer?
alias_attribute vs. alias_method for aliasing ActiveRecord attributes
Wolfram Arnold — Mon, 06/15/2009 - 18:29
I've just recently run into a situation where I wanted to add an alias for an accessor method that ActiveRecord creates on the fly.
As you know, if you have a column in your schema, then ActiveRecord will automatically set up the accessor methods, like so:
Now, if you want to access the user's name also by, say, "display_name", then you might ordinarily think you could just:
alias_method :display_name, :name
Rails 2.0 with Ruby 1.8.7
Wolfram Arnold — Fri, 05/29/2009 - 18:24
The Ruby 1.8.7 interpreter
$> ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
has a built-in method named "chars" which clashes with Rails 2.0's String extensions. The problem does not happen for Rails 2.1 or later.
The fix is simple. Add a file to config/initializers/ruby-1.8.7-string-workaround.rb as follows:
RSpec View testing: Mocking helpers vs. mocking controller methods
Wolfram Arnold — Mon, 05/11/2009 - 17:35
RSpec::Rails (I'm using version 1.2.2 as of this writing) has a really cool feature to test view templates. This is one of the features where RSpec really has a leg up on standard Rails functional tests.
You can test the view templates without the controller actions running, which has the nice side-effect that your actions and your views become less tightly coupled—and you're doing BDD, right?
Here is an example of testing a layout, you can do this without even relating to an action or a view template:
describe 'layouts/application' do
before(:each) do
The making of my first video
Wolfram Arnold — Wed, 03/18/2009 - 17:31
When I first started talking with Eric about founding RubyFocus, I've always had a strong sense of the story and beliefs I held that I wanted my clients to learn. I felt that just going around talking is one way, but it's one-on-one, and it also is just talking.
