I am working on an app with a requirement that has yielded an unexpected
problem for Rails routing.
We have several controllers that handle regional data (one controller
per data type - weather, demographics, etc). The problem is that there
is one region who’s actions and output are different.
We intend to create two controllers for each data type (i.e.
weather_controller to handle requests for all regions but the one and
regionx_weather_controller with its own special methods, data, and
So, with that in mind, the requirement is to have the url of the form:
That’s great for the main regions but this bastard region needs a
routing statement like:
map.connect ‘regionx/:special/:action’, :controller => ‘regionx_’ +
(which, of course, doesn’t work - or I wouldn’t be asking this)
Apparently :special gets packaged up as a param and sent to the
controller (if I name a valid one) but I can’t access the symbol here
for some reason.