Skip to content

Instantly share code, notes, and snippets.

@scottweisman
Created June 18, 2012 17:07
Show Gist options
  • Save scottweisman/2949454 to your computer and use it in GitHub Desktop.
Save scottweisman/2949454 to your computer and use it in GitHub Desktop.
nav_link content_tag
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