helper_methods 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|