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

Subject: [PATCH] Add exceptions for devise actions in the user route filter

---
 lib/route_filters/repository_owner_namespacing.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/route_filters/repository_owner_namespacing.rb
b/lib/route_filters/repository_owner_namespacing.rb
index b0df154..6c2a5d8 100644
--- a/lib/route_filters/repository_owner_namespacing.rb
+++ b/lib/route_filters/repository_owner_namespacing.rb
@@ -105,7 +105,7 @@ module RoutingFilter
       def reserved_actions_for_controller(controller)
         case controller
         when "users"
-          UsersController.action_methods.to_a
+          UsersController.action_methods.to_a + ["sessions", "sign_in",
"sign_out"]
         when "projects"
           ProjectsController.action_methods.to_a
         when "groups", "teams"
-- 


Christian

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

Reply via email to