getSeo match {
case Nil => Seq(/* your default seo*/)
case result => result
Hi Sarvesh
I get this when I add that def to my code
missing arguments for method getSeo in object Seo; follow this method with `_' if you want to treat it as a partially applied function
Hi
Does not work
[IndexOutOfBoundsException: 0]
The Seq[Seo] is not getting fill with default values :(
On Monday, February 4, 2013 12:57:10 PM UTC, Sarvesh Kumar Singh wrote:
THANKS Julien
I COULD CRY this works - thanks :) - I spent so many hours searching for this, I NEED to get better at Scala :)
THANKS
def getSeo(page : String) : Seq[Seo] = {
DB.withConnection { implicit connection =>
SQL("select * from seo where page = {page}").on('page -> page).as(Seo.pageseo *)
}
match {
case Nil => Seq( Seo("London", "hello", "o"))
case result => result