Em 27-05-2011 17:01, Christian Johansen escreveu:

        As we discussed on irc, I checked out your devise branch and
        looked at the generated URLs. However, according to `rake
        routes`, new_user_session resolves to "/users/sign_in", which
        is not the problem you reported. Do I have to poke in a
        particular way to provoke the error you described?


    Yes, the output of "rake routes" seems correct. You'll notice the
    problem in the links actually being generated. For instance, start
    the server in development environment and look at the generated
    links in the templates and using the url "/users/sign_in".


Ok, I should have spotted this immediately. Welcome to the fun world that is gitorious routing :) The problem is not the routing itself (which is why `rake routes` displays the right routes). The problem is the routing post filter (see the note on top of the routes.rb file, and lib/gitorious/reservations.rb). The thing is that there is a bit of custom stuff added to support stuff like the ~user and +team URLs. Right now, because the devise URLs are exposed in the /users namespace, the URLs are translated to user URLs.

To fix this you can add reservations for the URLs in question. Once we get closer to Rails 3 I want to review and simplify the routing system, but we'll have to keep it for now. For your referal, here is a patch that allows "/users/sign_in", "/users/sign_out" and "/users/sessions" to go through without filtering:

Thanks, great to know that. Maybe, another alternative would be to use :path_prefix => '/sessions' in devise_for call in routes.rb, if that is allowed by Gitorious Reservations.

What would you prefer?

--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]

Reply via email to