evanwalsh (owner)

Revisions

gist: 106101 Download_button fork
public
Public Clone URL: git://gist.github.com/106101.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
# 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