1

I've already installed the grails searchable plugin which is working fine. I would like to change its behaviour in order to have something like google's "I'am feeling lucky".

I copied the

myapp/plugins/searchable-x.x/grails-app/views/searchable/index.gsp 

to

/myapp/grails-app/views/searchable/index.gsp

At this file there is a result set called "results". The default behaviour is to create a list of links to the domain objects which fulfils the search.

I want to take the first element of this set (this is not a problem) and make a redirect to the page of this first object. Is this the correct place? If yes then the question is how to do this. If not, then should I try this at the controller?

Thanks!

Luixv
  • 8,590
  • 21
  • 84
  • 121
  • 3
    I think that the controller is a better place, since you will not display the list. If I'm not mistaken you can also change the params.max to 1 and not query unecessary records. –  Apr 26 '13 at 22:18
  • 1
    I think set the params.max makes more sense – allthenutsandbolts Apr 29 '13 at 21:34

0 Answers0