Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 17 additions and 8 deletions.
  1. +4 −0 CHANGELOG
  2. +6 −3 README.textile
  3. +7 −5 lib/crummy/action_controller.rb
@@ -1,3 +1,7 @@
+* [FIXED] Spacing in name argument was causing errors.
+* [FIXED] Bug where everything was getting parsed as an Array.
* [FIXED] html_safe! is no longer called by default. That's the user's prerogative to do now.
* [ADDED] Allow record to respond to to_s even if you pass a url or block.
9 README.textile
@@ -10,7 +10,7 @@ Simply add the dependency to your Gemfile:
- gem "crummy", "~> 1.3"
+ gem "crummy", "~> 1.3.5"
@@ -82,7 +82,7 @@ Render links in the output. Defaults to +true+
<code>:skip_if_blank => true</code>
-With this option, output will be blank if there are no breadcrumps.
+With this option, output will be blank if there are no breadcrumbs.
h3. Examples
@@ -100,11 +100,14 @@ With :format => :html_list you can specify additional params: :active_li_class,
h2. Notes
+Test library is at "Crummy Test":
h2. Todo
-* Port over rspecs from project to plugin (Fully tested in a project)
+* Accept collections of models as a single argument
* Accept instances of models as a single argument
* Allow for variables in names. (The workaround is to do your own before_filter for that currently)
+* Make a crumbs? type method
h2. Credits
12 lib/crummy/action_controller.rb
@@ -18,22 +18,24 @@ def add_crumb(name, *args)
url = instance.send url if url.is_a? Symbol
if url.present?
- if url.kind_of? Enumerable
+ if url.kind_of? Array! do |name|
name.is_a?(Symbol) ? instance.instance_variable_get("@#{name}") : name
- url = instance.send :url_for, url unless url.is_a? String
+ if not url.kind_of? String
+ url = instance.send :url_for, url
+ end
# Get the return value of the name if its a proc.
- transformed_name = name.is_a?(Proc) ? : name
+ name = if name.is_a?(Proc)
- _record = instance.instance_variable_get("@#{transformed_name}")
+ _record = instance.instance_variable_get("@#{name}") unless name.kind_of?(String)
if _record and _record.respond_to? :to_param
instance.add_crumb(_record.to_s, url || instance.url_for(_record))
- instance.add_crumb(transformed_name, url)
+ instance.add_crumb(name, url)
# FIXME: url = instance.url_for(name) if name.respond_to?("to_param") && url.nil?

No commit comments for this range

Something went wrong with that request. Please try again.