This project is archived and is in readonly mode.
In the new router, "can't use member outside resources scope"
-
Balazs Nagy
Why do you want to add a member to a single resource? Members expect that you want to reference of a resource by ID.
You can create extra routes for a resource like this:
resource :open_id do get :remove end -
Lasse Bunk
Sorry – my bad. I'll be using get :remove instead. Thanks. Out of curiosity, could you tell me what would've been right one to use instead of using a member on Rails < 3.0.0?
-
Lasse Bunk
Another thing is that
get :removeon a singular resource (resource :open_id) doesn't create theremove_open_id_pathroute helper that is created when usingmember do get :remove endon plural resources (
resources :open_id). Is that a bug? I can create the helper by specifying:as => :open_id(why does it have to be:open_id?) -
José Valim
- Assigned user set to josh
-
josh
- State changed from new to invalid
Right, you just need
resource :open_id do get :remove endThink of the inside of "resource" (singular) as already scoped with member.
-
Lasse Bunk
Ok – I get that... nicely done :)
The fact that it doesn't create a remove_open_id helper – is that a bug? -
josh
Sounds like it. Could you post a failing test.
-
Claudio Amoedo
I have the same issue with resource path helpers