Simple tooltip helper for Ruby on Rails

A simple tooltip helper with span tag and title attrbute for Ruby on Rails framework.

app/helpers/application_helper.rb

def tooltip(content, options = {}, html_options = {}, *parameters_for_method_reference)
html_options[:title] = options[:tooltip]
html_options[:class] = html_options[:class] || 'tooltip'
content_tag("span", content, html_options)
end

app/views/foo/bar.rhtml

< %= tooltip "Tags", { :tooltip => 'some keywords to categorize your data and help in future searches' }, :class => 'mytooltip' %>

public/stylesheets/yourstyle.css

.mytooltip {
cursor: help;
color: green;
border-bottom: 1px dotted green
}