Permalink
Browse files

Merge pull request #102 from SkyWriter/master

return context if context responds to controller, but returns nil (Gretel incompatibility)
  • Loading branch information...
2 parents 639eb2f + 8241f9b commit d9e744cc626feff1088d37e7188c4dbc4eeaa7b2 @andi andi committed Aug 18, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/simple_navigation/adapters/rails.rb
@@ -72,11 +72,9 @@ def html_safe(input)
# Extracts a controller from the context.
def extract_controller_from(context)
- if context.respond_to? :controller
- context.controller
- else
+ context.respond_to?(:controller) ?
+ context.controller || context :
context
- end
end
end

0 comments on commit d9e744c

Please sign in to comment.