Category Archives: Ruby on Rails
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 [...]
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 => [...]
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 [...]
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 gem, install, polymorphic associations, rails, setup, shoulda, troubleshooting, windows, windows7, xampp 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 [...]
Ajaxification
(Notes from Chapter 24 of “Agile Web Development with Rails, Third Edition”)
Posted in Ruby on Rails Tagged ajax, forms, javascript, prototype, rjs, templates, the book 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 actions, controllers, models, partials, render, templates, the book Comments closed
Action View: Forms
(Notes from Chapter 23 of “Agile Web Development with Rails, Third Edition”, sections 23.4 to 23.7)
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 controllers, erb, helpers, links, templates, the book, views Comments closed
Simple auto-complete in Ruby on Rails