Link_to() problem with controller in module

Hi, I am a newbie in ROR.

I have a controller in module - Admin::ProductController, and I am
paginating my search result (I read
http://wiki.rubyonrails.org/rails/pages/HowtoPagination).

However, the link generated by:

<%= link_to(‘next page’, {:params => params.merge(‘page’ =>
@item_pages.current.next)}) if @item_pages.current.next %>

is a relative path, making the full URL something like:

http://localhost:3000/admin/admin/product/list?query=book&page=2
^^^^^^^^^^^

Any advice for me? Thanks a lot!

…somewhere a ‘/’ is needed - that’s why the admin is printed twice =>
when you are on a page

http://www.domain.com/admin

and use the link, it adds the relative link to the existing
/admin(creating a bad /admin/admin). but if there were a ‘/’ in the
begining of the relative link you create, it would start it from the end
of the domain, and then you would get /admin/… in the correct way. i
think.

hope it helps,

harp

I understand your point. Thanks!

But it is a bad idea to modify params[:controller], isn’t it?

Are there any alternatives?