For the record, I believe I have discovered the problem.

Authlogic absolutely requires that there be a login field of some sort
in the User model -- even if you don't actually use it for logging in.
It also needs to contain some unique value, presumably, or there will
be validation problems. I simply used the email address people sign up
with initially, and also keep a copy of that in the emails table.

I assume this is a bug of some sort. It'd be great if Authlogic were
more informative with its error messages; without a login field, it
produces all kinds of unrelated errors.

Thanks so much for the help.

John

On Jan 10, 1:21 pm, John Woods <john.wo...@marcottelab.org> wrote:
> 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 <autige...@gmail.com> 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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to