How to use Twitter Bootstrap 3 with play framework 2.3

前端 未结 5 560
庸人自扰
庸人自扰 2021-01-04 19:04

I have been trying adding bootstrap\'s js and css files to public/javascripts and public/stylesheets application in play framework application. I donno why but I get a blan

5条回答
  •  無奈伤痛
    2021-01-04 20:04

    My solution was as follows:

    In build.sbt:

    libraryDependencies ++= Seq(
        "org.webjars" % "bootstrap" % "3.3.7"
    )
    

    In conf/routes, ensure you have the following line: (This should be included by default unless you deleted it)

    GET     /assets/*file               controllers.Assets.versioned(path="/public", file: Asset)
    

    In your file.scala.html file, you include bootstrap like so:

    
    
    
    • WebJars documentation

提交回复
热议问题