Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.43 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. UrlMapping causing method not to render different view than default
  2. class SearchController {
  3.   def list = {
  4.     List<Product> productsList = productRepository.findProductBySearchPhrase(params.searchPhrase)
  5.     render(view: "/product/list", model: [products: productsList])
  6.   }
  7. }
  8.  
  9. class UrlMappings {
  10.   "/$controller/$action?/$id?" {
  11.     constraints {}
  12.   }
  13.   "/search" {
  14.     controller = "search"
  15.     view = "list"
  16.     constraints {}
  17.   }
  18. }