This project is archived and is in readonly mode.

#2242 ✓resolved
Luca Guidi

Metal should respect ActionPack class name conventions

Reported by Luca Guidi | March 15th, 2009 @ 08:45 PM

I created a Metal piece for my blog for handle legacy routes:

# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)

class LegacyRoutes
    if env["PATH_INFO"] =~ /legacy_routes_regexp/
      [301, {"Location" => ""}, nil]

When I try to start the server it returns the following error:

/Library/Ruby/Gems/1.8/gems/activesupport-2.3.0/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant LegacyRoute (NameError)
# ...

This because in metal.rb classify is used instead of camelize (

This is different from ActionController behavior, where camelize is used (

I believe Metal should respect ActionPack class name conventions, i.e. articles_controller.rb => ArticlesController". If I'm wrong it should be documented. :)

I attached a patch for solve this issue.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket

Referenced by