score:1

Accepted answer

I have managed to solve it likewise:

MusicController.scala

  def show(id: Long) = Action.async { implicit request =>
    repo.findById(id).map { music =>
      Ok(views.html.musics.show(music))
    }
  }

MusicRepository.scala

  def findById(id: Long): Future[Music] = db.run {
    musics.filter(_.id === id).result.head
  }

Related Query

More Query from same tag