Sha256: 7409dd029cc3a0aadd521c3d7ec0a93629e894f53cbc77d14e51ea3ea932d004

Contents?: true

Size: 474 Bytes

Versions: 3

Compression:

Stored size: 474 Bytes

Contents

module SemanticRailsUi
  module NavHelper
    # Navigation link that adds active class for the currently active url
    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
semantic-rails-ui-1.0.5 app/helpers/semantic_rails_ui/nav_helper.rb
semantic-rails-ui-1.0.4 app/helpers/semantic_rails_ui/nav_helper.rb
semantic-rails-ui-0.3.0 app/helpers/semantic_rails_ui/nav_helper.rb