April 3rd, 2007

.erb lives a short life

Earlier this year the default Rails template extension switched from .rhtml to .erb and from .rxml to .builder. Yesterday Rick committed another change which modifies the defaults once again.

If you are keeping up with edge you should now be using .html.erb as opposed to .erb, and .xml.builder as opposed to .builder.

I assume this change was made to make a cleaner separation between the templating language being used and the content-type. This allows you to use something like .css.builder for css files rendered using builder, or .xml.erb for xml files using erb.

As always, Edge Rails is subject to change, use at your own risk!



March 29th, 2007

RSpec on Rails Matchers

While at the Mountain West Ruby Conf Matt and I implemented the first pass at the following rails matchers for rspec:

  • should belong_to(association)
  • should have_many(association)
  • should validate_confirmation_of(attribute)
  • should validate_format_of(attribute, valid => [], invalid => [])
  • should validate_length_of(attribute, range)
  • should validate_presence_of(attribute)
  • should validate_uniqueness_of(attribute)

Plugin available here: http://svn.integrumtech.com/public/plugins/rspecon_railsmatchers/

I haven’t had a chance to get the README done, or any rdoc, but there are specs for the majority of the matchers.

Comments / Suggestions Welcome!



March 28th, 2007

Goodbye ";", it's been fun!

The use of “;” to delineate non-crud member & collection actions has been replaced as of Changeset #6485 with the much loved “/” character.

As long as you’re using the default url generators (edituserpath) you shouldn’t have to change anything in your code. The only place this causes issues is if you’ve hard-coded URIs in your APIs or your users have bookmarked pages.



March 20th, 2007

Phoenix Rails Users Group

The Phoenix Rails Users Group will be meeting this evening at 6:00pm at the Molly Brannigans in Mesa, AZ.

Agenda:

  • 6:00 - 7:00 Social Hour
  • 7:00 - 8:00 Introduction to RSpec
  • 8:00 - 9:00 Hacking

Hope you can make it!