-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resources
macro _should_ accept a block for nesting unRESTful routes
#1321
Comments
resources
routes macro does not nest additional routes in the name space properlyresources
macro does not nest additional routes in the name space properly
I'm going to expand on this a bit, when using the After doing some digging I found the routes :web, "/admin" do
namespace "/users" do
post "/login", UsersController, :login
post "/logout", UsersController, :logout
post "/sign-up", UsersController, :create
end
resources "/users", UsersController, except: [:create]
end This produces the paths: /admin/users/show
/admin/users/login
/admin/users/logout
/admin/users/sign-up I found that when nesting namespaces a little deeper, the When I say "deeper" nested, I meant the As best I can tell, this is an issue with the |
resources
macro does not nest additional routes in the name space properlyresources
macro _should_ accept a block for nesting unRESTful routes
I updated my routing example after some further testing. A That exposes another concern: resource routes appear to be tightly coupled to integers for the actions that require an I need to explore this further, because this should be something we can change. Adding a |
If you have a route that looks like this:
I would expect the routes to be generated like this:
However, this does not happen. The routes are rendered like this:
We should fix this so that anytime you define a route within a
resources
block, it includes the named route root in the generated routeThe text was updated successfully, but these errors were encountered: