Module: SemanticRailsUi::NavHelper

Defined in:
app/helpers/semantic_rails_ui/nav_helper.rb

Instance Method Summary collapse

Instance Method Details

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, options = {}, &block)
  options, url, title = url, title, capture(&block) if block_given?
  options = { class_active: 'active item', class_inactive: 'item' }.merge(options || {})
  options = options.merge(active: :exact) if url == root_path
  active_link_to title, url, options
end