Play framework 2 template using method with two and more blocks of code (like Option.fold)

Can i use code with fold like methods?

Code in Playframework 2 template like

@userOpt.fold{
     <p>None</p>
}{user=>
     <p>@user</p>
}

compiled well, but IntelliJ IDEA 13 mark user red (Cannot resolve symbol user)

Using match case have no red marks, but  show
Remove redundant braces less... (Ctrl+F1)
This inspection reports redundant enclosing blocks around expressions        (including ones within interpolated strings).    

@userOpt match {
case scala.None => {     <---------------
     <p>None</p>
}
case Some(user) => {     <---------------
     <p>@user</p>
}

Please sign in to leave a comment.