I found this SO question only explain the code example for Java, tried Scala turn out a little different:
object Application extends Controller {
def index = Action {
Ok(views.html.index("1","2",Application.getSum("1","2"))) //<- Error type mismatch
}
def getSum(a: String,b: String):Int = Action {
val c = a.toInt + b.toInt;
} c
}