Welcome Guest | Login

ActionController::RoutingError (no route found to match "/Home" ...

I've confirmed that my db is migrated and has the Home page, and the users table is setup (login_generator) and I've killed the fcgi process...

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<-----------------------------

2007-02-05 09:40 PM

Its a good habit to use only lowercase when dealing with routes.  try home.  Try also setting a default route to one of those you're working on and see if that works.  Also, when you go to /login, what does your log say?

2007-02-06 02:21 AM

D'oh my ~/public_html/[link_to_rails_public] was whacked from my recent debugging of the capistrano 1.4 chmod glitch and was pointing to an old version in the cap_root/releases/###. I guess I should have checked to make sure my rails app was "plugged in" :).  The InitCap in the URL routes to the page by name just fine. Thanks.

2007-02-06 08:49 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.