title: Scala - Cannot use a method returning play.api.mvc.Result as a Handler for requests
body: <p>I have this controller in Scala:</p>
  
  <pre><code>def commonRedirect(anId: Long) = {
  implicit val aRule = CommonClient.getTheRule(anId)
  aRule match {
    case false ⇒ Redirect("/general-rule/" + anId)
    case true  ⇒ Redirect("/custom-rule/" + anId)
  }
  </code></pre>
  
  <p>}</p>
  
  <p>but, this result in the error: "Cannot use a method returning play.api.mvc.Result as a Handler for requests".</p>
  
  <p>If I apply an Action Builder, it works, but this is not the way that I want.</p>
  
  <p>Any ideas to resolve this?</p>
  
  <p>Thanks.</p>