Grails g:paginate tag and custom URL
- by aboxy
Hello,
I am trying to use g:paginate in a shared template where depending on the controller, url changes e.g.
For my homepage url should be : mydomain[DOT]com/news/recent/(1..n)
For search Page: www[DOT]mydomain[DOT]com/search/query/"ipad apps"/filter/this month
and my g:paginate looks like this:
g:paginate controller=${customeController} action=${customAction} total:${total}
For the first case, I was able to provide controller as 'news' and action as 'recent' and mapped url /news/recent/$offset to my controller.
But for the search page, I am not able to achieve what I want to do. I have a URL mapping defined as /search/$filter**(controller:"search",action:"fetch")
$filter can be /query/"ipad apps"/filter/thismonth/filter/something/filter/somethingelse.
I want to be able to show the url as above rather than
?query="ipad apps"&filter=thismonth&filter=something&filter=somethingelse.
I believe I can pass all the parameters in params attribute of g:paginate but that will not give me pretty URL.
What would be the best way to achieve this? Please feel free to ask questions If i missed anything.Thanks in advance.