
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
= breadcrumbs_for
Breadcrumbs Rails helper.
Breadcrumbs helper for Rails done in a rails way.
Built on url_for, your routes, model names and i18n.
== Installation gem install breadcrumbs_for
== Requirements Was tested with Rails 3
== Usage Let say:
===Examples: breadcrumbs_for :blogs # Home / Blogs breadcrumbs_for :blogs, 'new' # Home / Blogs / New breadcrumbs_for :blogs, @blog # Home / Blogs / My blog breadcrumbs_for :blogs, @blog, 'edit' # Home / Blogs / My blog / Edit breadcrumbs_for @blog # Home / My blog breadcrumbs_for :blogs, @blog, [@blog, @post] # Home / Blogs / My blog / My Post
breadcrumbs_for [:admin,:blogs], [:admin, @blog] breadcrumbs_for [:admin,:blogs], ['edit', :admin, @blog, @post] breadcrumbs_for [:admin,:blogs], [:admin, @blog], ['edit', :admin, @blog, @post]
etc.
Note: There is a shorter alias crumbs_for, so you can do: crumbs_for :blogs, @blog
You can even do the following: breadcrumbs_for {:controller=>'blogs', :action=>'index', :crumb=>'All Blogs'}, @blog Note on :crumb=>'All Blogs'. Here you need to provide the breadcrumb caption text directly via the :crumb key.
If you have an admin_path in your routes you can do: breadcrumbs_for :admin, [:admin,:blogs], ['new', :admin, @blog], :crumbs_options=>{:root=>false}
=== Produced HTML By default it will render breadcrumbs as an unordered list.
The following code
<%= crumbs_for :posts, 'New' %>
will produce html:
You can also render bredcrumbs in plain.
The following code
<%= crumbs_for :posts, 'New', :crumbs_options => { :type => :plain } %>
will produce html:
=== Customize
=== Custom captions and i18n Define captions for breadcrumbs in your locale file: en: breadcrumbs: root: 'Home' actions: new: 'Add new' edit: 'Edit one' names: admin: 'Manage' blogs: 'The blogs' posts: 'The posts'
=== Tips & Tricks When providing action as a String it will include action name in breadcrumb caption.
crumbs_for :blogs, ['edit', @blog] # => Home / Blogs / Edit My blog
When providing action as a Symbol it will skip action name in breadcrumb caption.
crumbs_for :blogs, [:edit, @blog] # => Home / Blogs / My blog
== Note on Patches/Pull Requests
Patches/Pull Requests are welcome!
== Copyright
Copyright (c) 2010 Dmitry Naumov. Released under the MIT license. See LICENSE for details.
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.