2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Railsでhonoka4.1.3を追加する(手動)

Posted at

公式サイトからhonokaをDL

http://honokak.osaka
スクリーンショット 2018-09-09 18.33.37.jpg

スクリーンショット 2018-09-09 18.38.02.jpg

中はこんな感じ

honoka/
 ├bootstrap.html
 ├css/─bootstrap.css
 │    └bootstrap.min.css
 │
 ├ js/─bootstrap.build.js
 │    ├bootstrap.build.min.js
 │    ├bootstrap.js
 │    └bootstrap.min.js
 ├LICENSE
 └ README.md

##bootstrap.min.cssとbootstrap.min.jsを使う

rails_app/
 ├app/
 │   └assets/
 │        ├javascripts/ <- bootstrap.min.jsを追加する
 │        └stylesheets/ <- bootstrap.min.cssを追加する
 ├bin/
 ├config/
 ├db/
 ...

###bootstrap.min.jsを追加
スクリーンショット 2018-09-09 18.57.00.jpg

###application.jsでbootstrap.min.jsを使えるようにする

rails_app/app/assets/javascripts/application.js
// This is a manifest file that'll be compiled into application.js, which will include all the files
// ...
// about supported directives.
//
//= require bootstrap.min <- 追記
//= require ...
//= require ...
...
//= require_tree .

###bootstrap.min.cssを追加
スクリーンショット 2018-09-09 18.57.17.jpg

###application.cssでbootstrap.min.cssを使えるようにする

rails_app/app/assets/stylesheets/application.css
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
...
 *
 *= require bootstrap.min <- 追加
 *= require_tree .
 *= require_self
 */

###デモページを試す

rails g controller honoka demo

rails_app/app/views/honoka/demo.erb.html
の中身を honoka/bootstrap.html で上書きする

rails s

localhost:3000/honoka/demoをひらく

確認が済んだら消去する

rails g destroy controller honoka

参考文献
Rails5に日本語を美しく表示できるBootstrapテーマ「Honoka」を導入!

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?