Skip to content
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

Error generating namespaced routes with parameters #128

Open
lleirborras opened this issue May 13, 2011 · 2 comments
Open

Error generating namespaced routes with parameters #128

lleirborras opened this issue May 13, 2011 · 2 comments

Comments

@lleirborras
Copy link

Hi, I've got something like this in my routes.rb

namespace :somewhere, :path => "/somewhere/:somewhere_id" do
resources :posts
end

and in a view I call the will_paginate like always
<%= will_paginate @posts%>

and it generates routes like this
"/somewhere/posts?page=X&somewhere_id=Y"
while routes should be
"/somewhere/Y/posts?page=X"

I partialy solved it calling the helper in this way
<%= will_paginate(@posts, :params => {:controller => somewhere_posts_path(Y)})
but t'hats not so cute, and also it generates a not so valid ok route
"/somewhere/Y/posts?page=X&somewhere_id=Y"

Is there any way to work with namespaced routes?

@acesuares
Copy link

I have more or less the same problem, will_paginate generates the 'wrong' links for my situation.

@plukevdh
Copy link

Also have this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants