lib/nav.rb in nav-0.1.0 vs lib/nav.rb in nav-0.2.0
- old
+ new
@@ -72,9 +72,10 @@
current = options[:current]
is_current = case current
when TrueClass then true
when Regexp then request_uri.match(current).nil? ? false : true
+ when Proc then current.call
else false
end
return true if is_current && !options[:disabled] && options[:force_current]
return true if is_current || !url_for_options.is_a?(Symbol) && @template.current_page?(url_for_options) && url_for_options != {} && !options[:disabled]