LoginSignup
2
2

More than 5 years have passed since last update.

bootstrap-sassとbreadcrubs_on_railsを組み込んだ時のバグ対応

Last updated at Posted at 2014-07-12

下記のエラーが発生した時に自分がとった対策をメモしておきます。
なお、一度うまく動いたら下記のエラーを再現できなくなったため、原因が別にある可能性もあります。

エラーの文言

Routing error
undefined method `add_breadcrumb' for ApplicationController

自分がとった対応

Gemfileの順番を入れ替える

bootstrapの前にbreadcrumbsを記述しました

Gemfile
+ gem 'breadcrumbs_on_rails'
  gem 'bootstrap-sass'
  gem 'sass-rails',   '~> 3.2.3'
  gem 'autoprefixer-rails'
- gem 'breadcrumbs_on_rails'

Gemfileを編集、サーバ再起動後に出た別のエラーに対応する

自分の場合はcouldn't find file twitter/bootstrapと言われたので、下記の編集をしました。

app/assets/javascripts/application.js
- //= require twitter/bootstrap
+ //= require bootstrap-sprockets

するとあら不思議、エラー無くadd_breadcrumbが使えるようになりました。

以上、誰かの参考になれば幸いです。
原因の分かる方が居ましたら、教えていただきたいです。

参考
https://github.com/scambra/devise_invitable/issues/239
http://stackoverflow.com/questions/21807363/routing-error-undefined-method-add-breadcrumb-for-controllerclass

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