Technically it might not even be a bug, it seems to be matching on
:controller/:action/:id. What do you have in your routes file?
But even more fundamentally, why are you calling recognize_path
directly? Perhaps there's an easier way?
> thanks,
> andy
>
> --
> Andrew Stone
>
> >
>
--
Cheers
Koz
Technically it might not even be a bug, it seems to be matching on
:controller/:action/:id. What do you have in your routes file?
But even more fundamentally, why are you calling recognize_path
directly? Perhaps there's an easier way?
If there is an easier way, that would be great.
The routes file contains just a simple map.resources :users.
It's being used in lockdown for the case when someone passes in a named route to the link_to method, such as:
link_to "Login", login_path
I need to get the actual path to either grant/deny the ability to show the link. I was using recognize_path to return the hash related to the named route.
Does that explain it? Let me know if more info is needed.
map.login, :controller => "sessions", :action => "destroy"
Does the /users/1/edit url actually *go* to the right place when you access it?
> It's being used in lockdown for the case when someone passes in a named
> route to the link_to method, such as:
>
> link_to "Login", login_path
>
> I need to get the actual path to either grant/deny the ability to show the
> link. I was using recognize_path to return the hash related to the named
> route.
>
> Does that explain it? Let me know if more info is needed.
I assume map.connect ':controller/:action/:id' is either removed or
comes *after* the map.resources call? If it's the other way around
then this if functioning as intended.
> thanks,
> andy
>
> --
> Andrew Stone
>
> >
>
--
Cheers
Koz
Does the /users/1/edit url actually *go* to the right place when you access it?
> If there is an easier way, that would be great.
>
> The routes file contains just a simple map.resources :users.
I assume map.connect ':controller/:action/:id' is either removed or
> It's being used in lockdown for the case when someone passes in a named
> route to the link_to method, such as:
>
> link_to "Login", login_path
>
> I need to get the actual path to either grant/deny the ability to show the
> link. I was using recognize_path to return the hash related to the named
> route.
>
> Does that explain it? Let me know if more info is needed.
comes *after* the map.resources call? If it's the other way around
then this if functioning as intended.
Well that's very strange...
> map.connect ':controller/:action/:id' is at the end of my routes file. This
> is the way it should be, right?
The only other thing I can think of is the request method, which is
also something that affects route matching. you may need to provide
recognize_path with more information in the enviroment hash to make
sure it matches correctly. If you can reproduce this in a tiny test
app, and upload it to lighthouse, people may be able to give you a
hand. Similarly if you can make it fail in the routing tests that'd
make things easier.
--
Cheers
Koz