1
0

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.

パンくず作成Gem「gretel」の設定の解説

Posted at

gretelに表示させるパンくずの設定の意味が理解出来なかったので忘備録。
公式ドキュメントや他の導入事例と合わせて読むと分かるはず。

スクリーンショット 2019-05-23 11.27.23.png

画像上部のルートパスが下のbreadcrumb.rbのパスになる
Ex.)showのパスは myappsなので、breadcrumb.rb の該当記載で myapp_path と記載する。

またshowで言えばcrumb :myapps_show doと記載されているmyapps_showがviewページに埋め込む際に必要となる情報である。
Ex.)show.html.erbには <% breadcrumb :myapps_show %>と埋め込む

application.html.erbに埋め込むコードは
<%= breadcrumbs pretext: "You are here: ", separator: " › " %>
の方

参考記事:
https://qiita.com/you8/items/d2d37a745060b79c112f
https://github.com/WilHall/gretel
http://vdeep.net/rubyonrails-gretel

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?