Sha256: 6296cf1bec2111a1ba7837e8f91144df97f2be12d8e8cf3058f2782aa38990a0

Contents?: true

Size: 388 Bytes

Versions: 1

Compression:

Stored size: 388 Bytes

Contents

module NavigationHelper
  def nav_link(text, link_path, options = {}, &block)
    active_class_name = current_page?(link_path) ? options.fetch(:active_class_name, 'active') : ''
    inner = capture(&block)
    content_tag(:li, class: options.fetch(:class_name, '')) do
      concat(link_to(text, link_path, class: active_class_name)).concat( block_given? ? inner : "" )
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bootstrap_toolbelt-0.0.7 app/helpers/navigation_helper.rb