Category Archives: Ruby on Rails

General notes taken while reading about Ruby on Rails.

Simple auto-complete in Ruby on Rails

The Slash7 tutorial on Ajaxariffic Autocomplete with Scriptaculous was helpful, but it is a bit outdated, considering that it is from 2005. You’re going to want to download the latest version of Scriptaculous directly from its website – the article links to the current version at the time of writing, in 2005. The Ruby pieces that [...]
Posted in Ruby on Rails | Tagged | Comments closed

Calendar in Ruby on Rails

One of the things that I like about working with Ruby on Rails is that it’s really easy to find a plugin for something you’re trying to do, instead of having to re-invent the wheel. Petrik de Heus has written a beautiful plugin for building a calendar using HTML: table_builder plugin on github It takes [...]
Posted in Ruby on Rails | Tagged | Comments closed

The powers of Mocha and Shoulda combined

I’ve recently started using Mocha. It was pretty easy to integrate into my unit tests and sped them up somewhat. I added one line to my test_helper.rb: require 'mocha' I separated my should blocks into contexts by the mocks I needed to use and created mocks in my setup blocks: @plugin_value_mock = mock('PluginName::ClassValue') @plugin_value_mock.stubs(:value => [...]
Posted in Ruby on Rails | Tagged , , , , | Comments closed

Re-factoring contexts with Shoulda

I’ve been playing around with Ruby on Rails for a personal project that I started in December and as we starting doing with MarkUs last fall thanks to Gabriel, I’ve been using Shoulda for my tests. One of the basic tenets of Ruby on Rails is DRY – Don’t Repeat Yourself. And I’ve often found [...]
Posted in Ruby on Rails | Tagged , | Comments closed

Today in the saga of Installing Ruby on Rails on Windows 7

After countless problems today, I ended up rolling Rails back to version 2.3.4 and Ruby to version 1.8.6. Note: it may say to Ctrl-C to shutdown the server, but you actually have to do Ctrl+Break. And note to self: Some of my tests use the “should_ensure_length_at_most” macro in shoulda, which for some reason isn’t in [...]
Posted in Ruby on Rails | Tagged , , , , , , , , , | Comments closed

Installing Ruby on Rails in Windows 7

I recently installed Windows 7 Professional on my laptop. It was perfect timing since I was starting to have issues going into standby on my Windows XP Professional install, so it was about time since I would have re-formatted soon anyways. It has, for the most part, been a seamless upgrade. The Control Panel was completely [...]
Posted in Ruby on Rails | Tagged , , , , , , , | Comments closed

Ajaxification

(Notes from Chapter 24 of “Agile Web Development with Rails, Third Edition”)
Posted in Ruby on Rails | Tagged , , , , , , | Comments closed

More on Templates

(Notes from Chapter 23 of “Agile Web Development with Rails, Third Edition”, section 23.9)
Posted in Ruby on Rails | Tagged , , , , , , | Comments closed

Action View: Forms

(Notes from Chapter 23 of “Agile Web Development with Rails, Third Edition”, sections 23.4 to 23.7)
Posted in Ruby on Rails | Tagged , , , | Comments closed

Action View: Templates

(Notes from Chapter 23 of “Agile Web Development with Rails, Third Edition”, sections 23.1 to 23.3)
Posted in Ruby on Rails | Tagged , , , , , , | Comments closed