Monday, February 7, 2011

Rails resource helper methods and the mistakes I make using them

Here is something that always trips me up when I am working with Rails resources and I do not for the life of me know why:


ariel@bloodchoke demo$ rails console
Loading development environment (Rails 3.0.3)
ree-1.8.7-2010.02 > w = Widget.create!(:name => 'foo')
 => # 
ree-1.8.7-2010.02 > app.widgets_path(w)
 => "/widgets.1"
ree-1.8.7-2010.02 > app.widget_path(w)
 => "/widgets/1"


Why doesn't Rails raise an exception when I try to do this?

No comments: