def link(name, options={}, html_options={})
      link_to_unless_current(name, options, html_options) do
        html_options[:class] = (html_options[:class] || "").split(" ").push("active").join(" ")
        link_to(name, options, html_options)
      end
    end
def link(name, options={}, html_options={})
      link_to_unless_current(name, options, html_options) do
        html_options[:class] = (html_options[:class] || "").split(" ").push("active").join(" ")
        link_to(name, options, html_options)
      end
    end
This works just like link_to, but with one difference..
 If the link is to the current page, a class of 'active' is added