I'm trying to set up and 'admin' interface for each of my models.
I have a controller for each of them under 'app/controllers/admin/' book_controller.rb page_controller.rb and so on.
So as not to get in the way of normal use I'm 'forcing' a prefix in the routing/url with lines in routes.rb like
map.connect '/admin/page/:page/:action', :controller => 'admin/page_controller', :action => 'show', :requirements => { :page => page_name_requirement }
when I experiment with app.url_for() in the console I get the results I expect.
But when I fire up the server and try to go to
http://localhost.:3000/admin/page/ChapterOne
I get
NameError in Admin/web controllerController#list
uninitialized constant Admin::WebControllerController
Two questions:
Should my controller read:
class Admin::WebController < ApplicationController
which was how it was generated
and/or should the routing be fudged in some way.
Remember, this is not the 'real' application. The real application comes out at
http://localhost.:3000/TheStoryofLitchfileld/ChapterOne
and the routing for that is lower down in the routes.rb