Created
June 18, 2012 17:07
-
-
Save scottweisman/2949454 to your computer and use it in GitHub Desktop.
nav_link content_tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def nav_link(link_text, link_path) | |
class_name = current_page?(link_path) ? 'active' : '' | |
content_tag(:li, :class => class_name) do | |
link_to link_text, link_path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment