You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: