helper_methods 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/helper_methods/version.rb +1 -1
- data/lib/helper_methods.rb +8 -0
- metadata +1 -1
data/lib/helper_methods.rb
CHANGED
@@ -88,6 +88,14 @@ module HelperMethods
|
|
88
88
|
wrap_tag ? content_tag(wrap_tag, link, :class => css_class) : link
|
89
89
|
end
|
90
90
|
|
91
|
+
def active_link_to_class(url, options = {})
|
92
|
+
if is_active_link?(url, options[:active])
|
93
|
+
options[:class_active] || 'active'
|
94
|
+
else
|
95
|
+
options[:class_inactive] || ''
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
91
99
|
def is_active_link?(url, condition = nil)
|
92
100
|
url = url_for(url).sub(/\?.*/, '') # ignore GET params
|
93
101
|
case condition
|