Controllers names in Rails routes

Today I was stuck for a while over simple issue. After I wrote bunch of simple changes to code I’ve got following error in log/developmnent.log (remember Atomic Coding could help to find out earlier):

NoMethodError (undefined method `camelize' for :account:Symbol):
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1284:in `recognize'

In fact I was changing conf/routes.rb. After a while I discovered problem with:

  map.connect 'mybooks', :controller => :account, 
                                         :action => 'list'

Working entry looks like this:

  map.connect 'mybooks', :controller => 'account', 
                                         :action => 'list'

In route.rb don’t use symbolized controllers names, only strings.

Join the Conversation

1 Comment

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.