Skip to content

Instantly share code, notes, and snippets.

@brennandunn
Created September 28, 2008 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brennandunn/13494 to your computer and use it in GitHub Desktop.
Save brennandunn/13494 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
@kibyegn
Copy link

kibyegn commented Nov 18, 2010

neat solution to this common problem. Thanks alot

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