Hi Lee, and thanks so much for your reply.
I checked over my routes, and I think I have resolved a few issues
that might have been preventing the login page from working correctly
-- but alas, not all of them. I'm still getting exactly the same
problems when serving the login page.
One issue is that I don't create new users through the
UsersController, but rather through PeopleController (each User
belongs_to :person). I have in UsersController's new and create
methods simple redirects to equivalent methods in PeopleController.
Otherwise, here is a sample of my routes.rb file. I admit that I am
behind on my understanding of this config compared to other elements
of rails.
ActionController::Routing::Routes.draw do |map|
map.resource :account, :controller => "users" # this formerly
pointed to people instead of users
map.resources :users
map.resources :pages
begin
Page.all.each do |page|
Rails.logger.info("Connecting page #{page.title}")
map.connect page.slug, :controller => 'pages', :action =>
'show', :id => page.id
end
rescue
Rails.logger.error("Could not connect Page routes")
end
# ... other normal resources ...
map.resources :people
map.resources :password_resets
map.resource :user_session
# map.resources :user_sessions # I just removed this one
map.login 'login', :controller => 'user_sessions', :action => 'new'
map.logout 'logout', :controller => 'user_sessions', :action =>
'destroy'
# Set default root
map.root :controller => "people", :action => "new"
# 404: Not found has ID 404
begin
not_found_page = Page.find 404
unless not_found_page.nil?
map.error '*url', :controller => 'pages', :action => 'show', :id
=> 404
end
rescue
Rails.logger.error("Could not connect 404 Page route")
end
# Install the default routes as the lowest priority.
# Note: These default routes make all actions in every controller
accessible via GET requests. You should
# consider removing or commenting them out if you're using named
routes and resources.
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
Again, thanks for your assistance.
John
On Jan 9, 10:28 pm, Lee Smith <[email protected]> wrote:
> Check your routes to make sure you've configured the login correctly:
>
> rake routes
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.