Module: StaticHelper
- Defined in:
- app/helpers/static_helper.rb
Instance Method Summary collapse
Instance Method Details
#selected?(regex) ⇒ Boolean
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/helpers/static_helper.rb', line 3 def selected?(regex) if regex.is_a?(String) regex = /#{regex}/ end @selected = '' if !params[:path].nil? if params[:path] =~ regex @selected = ' class="selected"' end elsif params[:controller] =~ regex @selected = ' class="selected"' end @selected.html_safe end |