Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[FIXED] Spacing in name argument was causing errors. - Closes #17

  • Loading branch information...
commit 7b997e1c703dcc05970adf4ef0274874401b5503 1 parent e50f677
Zach Inglis authored
Showing with 5 additions and 4 deletions.
  1. +2 −1  CHANGELOG
  2. +3 −3 lib/crummy/action_controller.rb
View
3  CHANGELOG
@@ -1,4 +1,5 @@
-1.3.1
+1.3.5
+* [FIXED] Spacing in name argument was causing errors.
* [FIXED] Bug where everything was getting parsed as an Array.
1.3
View
6 lib/crummy/action_controller.rb
@@ -27,13 +27,13 @@ def add_crumb(name, *args)
end
# Get the return value of the name if its a proc.
- transformed_name = name.is_a?(Proc) ? name.call(instance) : name
+ name = name.call(instance) 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))
else
- instance.add_crumb(transformed_name, url)
+ instance.add_crumb(name, url)
end
# FIXME: url = instance.url_for(name) if name.respond_to?("to_param") && url.nil?

0 comments on commit 7b997e1

Please sign in to comment.
Something went wrong with that request. Please try again.