Created
May 3, 2009 18:28
-
-
Save evanwalsh/106101 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# This helper method will either generate a regular link => <a href="/whatever">Whatever</a> | |
# or it will generate a link with a "current class => <a href="/whatever" class="current">Whatever</a> | |
# Easy, huh? | |
def link_to_or_current(name, options = {}, html_options = {}) | |
link_to_unless_current(name, options, html_options) do | |
link_to(name, options, { :class => :current }) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment