Neither /Home nor nor /page/show/Home nor /login nor /login/login ... will route (they will under webrick on my desktop box).
Thanks in advance...
Jeff
log/production.log
------------------------8<-----------------------------
Processing ApplicationController#index (for 70.122.3.119 at 2007-02-05 21:22:50)
[GET]
Session ID: abf1d44581e2f7f95ae858b2f6b0dee3
Parameters: {}
ActionController::RoutingError (no route found to match "/Home" with {:method=>:
get}):
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_controller/ro
uting.rb:1266:in `recognize_path'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_controller/ro
uting.rb:1256:in `recognize'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/dispatcher.rb:40:in `dispa
tch'
[...]
------------------------8<-----------------------------
config/routes.rb
------------------------8<-----------------------------
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
# This route can be invoked with purchase_url(:id => product.id)
# You can have the root of your site routed by hooking up ''
# -- just remember to delete public/index.html.
# map.connect '', :controller => "welcome"
# Allow downloading Web Service WSDL as a file with an extension
# instead of a file named 'wsdl'
map.connect ':controller/service.wsdl', :action => 'wsdl'
map.connect '', { :controller => 'test', :action => 'debug' }
map.connect '/:name', {
:controller => 'page',
:action => 'show',
:name => /[A-Z]+.*/ ,
}
map.connect '/page/:action/:name', {
:controller => 'page',
:name => /[A-Z]+.*/,
}
# Install the default route as the lowest priority.
map.connect ':controller/:action/:id.:format'
map.connect ':controller/:action/:id'
end
------------------------8<-----------------------------
app/controllers/page_controller.rb
------------------------8<-----------------------------
class PageController < ApplicationController
def index
redirect_to :action => 'list'
end
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ]
before_filter :login_required, :except => [ :index, :show ]
def list
@page_pages, @pages = paginate :pages, :per_page => 100
end
def show
@page = Page.find_by_name(params[:name])
if ! @page
if params[:name]
@page = Page.new
@page.name = params[:name]
render :action => 'new'
else
raise ::ActionController::RoutingError, "Page Not Specified"
end
end
end
def create
@page = Page.new(params[:page])
if @page.save
flash[:notice] = 'Page was successfully created.'
redirect_to :action => 'show', :name => @page.name
else
render :action => 'new'
end
end
def edit
@page = Page.find_by_name(params[:name])
end
def update
@page = Page.find(params[:id])
if @page.update_attributes(params[:page])
flash[:notice] = 'Page was successfully updated.'
redirect_to :action => 'show', :name => @page.name
else
render :action => 'edit'
end
end
def destroy
Page.find_by_name(params[:name]).destroy
redirect_to '/'
end
end
------------------------8<-----------------------------