Module: SemanticRailsUi::NavHelper
- Defined in:
- app/helpers/semantic_rails_ui/nav_helper.rb
Instance Method Summary collapse
-
#ui_nav_link_to(title = nil, url = nil, options = {}, &block) ⇒ Object
Navigation link that adds active class for the currently active url.
Instance Method Details
#ui_nav_link_to(title = nil, url = nil, options = {}, &block) ⇒ Object
Navigation link that adds active class for the currently active url
4 5 6 7 8 9 |
# File 'app/helpers/semantic_rails_ui/nav_helper.rb', line 4 def ui_nav_link_to(title = nil, url = nil, = {}, &block) , url, title = url, title, capture(&block) if block_given? = { class_active: 'active item', class_inactive: 'item' }.merge( || {}) = .merge(active: :exact) if url == root_path active_link_to title, url, end |