Breadcrumbs in Ruby on Rails

前端 未结 6 853
猫巷女王i
猫巷女王i 2021-02-01 07:02

I\'m slightly insecure about my breadcrumb solution. Names and links are defined in each controller action:

Home         


        
6条回答
  •  醉话见心
    2021-02-01 07:49

    You could also use Ariane http://github.com/simonc/ariane

    With it you can generate any kind of breadcrumb, as links in a paragraph or as a ul/li :)

    If you want something specific, you can create your own renderer.

    It's pretty simple to use, just add this in a before_filter:

    ariane.add 'Home', root_path # in the app controller to have it everywhere
    ariane.add 'Some Page', some_path
    

提交回复
热议问题