Skip to content

Instantly share code, notes, and snippets.

@iwasrobbed
Forked from brennandunn/gist:13494
Created March 3, 2011 18:25
Show Gist options
  • Save iwasrobbed/853223 to your computer and use it in GitHub Desktop.
Save iwasrobbed/853223 to your computer and use it in GitHub Desktop.
def link_to_with_highlight(name, options = {}, html_options = {}) # same sig as #link_to
html_options.merge!({ :class => 'active' }) if current_page?(options)
link_to(name, options, html_options)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment