Module: BootstrapActiveNav::ViewHelpers
- Defined in:
- lib/bootstrap_active_nav/view_helpers.rb
Instance Method Summary collapse
Instance Method Details
#nav_link(link_text, link_path, options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bootstrap_active_nav/view_helpers.rb', line 3 def nav_link(link_text, link_path, = {}) .reverse_merge!({ :active => "active", :default => "" }) class_name = current_page?(link_path) ? "#{[:default]} #{[:active]}" : [:default] content_tag(:li, :class => class_name) do link_to link_path, do if block_given? yield else link_text end end end end |