9
9

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 4.x] Turbolinksを使用した遷移時にだけ Progress Bar を使う

Last updated at Posted at 2014-05-14

Progress Bar(プログレスバー)とは

こんな感じです。(ちょっと違いますが...)

Download-Progress-Bar.jpg

youtubeで画面遷移をするとき、画面のうえのほうで左から右へ何かが流れていく、あれです。

それを、Turbolinksで遷移した際に表示できる様にします。

これを使います

インストール & 設定

Gemfile

gem 'nprogress-rails'
$ bundle install

もしくは

$ gem install nprogress-rails

application.js(.coffee)に追記

//= require nprogress
//= require nprogress-turbolinks

application.css.scssに追記

*= require nprogress
*= require nprogress-bootstrap

もうちょっと細かい設定

application.js(.coffee)に追記。

NProgress.configure {
  showSpinner: false,
  ease: 'ease',
  speed: 500,
}

これだけで動きます。

詳細

9
9
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
9
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?