Skip to content

Instantly share code, notes, and snippets.

@zillou
Created September 9, 2013 07:58
Show Gist options
  • Save zillou/6492675 to your computer and use it in GitHub Desktop.
Save zillou/6492675 to your computer and use it in GitHub Desktop.
def nav_link_to(link_text, link_path)
class_name = current_page?(link_path) ? 'selected' : ''
content_tag(:li, class: class_name) do
link_to link_text, link_path
end
end
@zillou
Copy link
Author

zillou commented Sep 9, 2013

link_to_unless_current maybe a better choice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment