Module: OkonomiUiKit::ApplicationHelper
- Defined in:
- app/helpers/okonomi_ui_kit/application_helper.rb
Instance Method Summary collapse
Instance Method Details
#active_link_to(path, options = {}, &block) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/helpers/okonomi_ui_kit/application_helper.rb', line 3 def active_link_to(path, = {}, &block) path_to_check = path.split("?").first if ([:exact] && request.path == path_to_check) || (![:exact] && request.path.include?(path_to_check)) [:class] = [:active_class].presence || [ [:class], "active" ].compact.join(" ") end link_to(path, , &block) end |