Alexのぶろぐ

programming/scala/play!/php/javascript/three.js/unity/xcode5/rails/rubymine メモ用です

play2.2系にbootstrap3系を入れる方法

build.sbtに直接bootstrapいれてという記述をしたらなぜか怒られた

ので

play.Keys.lessEntryPoints <<= baseDirectory { base =>

   (base / "app" / "assets" / "stylesheets" / "bootstrap" * "bootstrap.less") +++
   (base / "app" / "assets" / "stylesheets" / "bootstrap" * "responsive.less") +++
   (base / "app" / "assets" / "stylesheets" * "*.less")
}

をbuild.sbtに記述し、

参考サイトにあるgitのリンクからzipをダウンロードしてassetの部分を

"プロジェクト名/asset"以下に置いたらできた

 

念願のフラットデザイン!!!

 

参考:http://stackoverflow.com/questions/21551602/play-2-2-1-twitter-bootstrap-3-less-setup

Play For Scala つまずいたところ2

detail.scala.htmlで

@(product: Product)(implicit flash:Flash, lang: Lang)

の部分のflash:Flashが本では抜けてる

 

エラー文をちゃんとみればすぐわかる問題だがよくみてなかったので時間をとられた

Play For Scala つまずいたところ

routeで

'GET /products/new'を‘GET /products/:ean'の後ろに記述しないとエラーがでる

参考:http://www.manning-sandbox.com/thread.jspa;jsessionid=f0HFJnZp0s7PO1E7?messageID=131178&#131178

 

The route for ‘GET /products/new’ has to be before the route for ‘GET /products/:ean’ - the first route in the file matches, and if you have them the wrong way around, /products/new matches the other route, and the router tries to parse 'new' as the Long ':ean' parameter. 

 

よくわからない、、、