How to insert class name with link_to

link_to(name, options = {}, html_options = nil, *parameters_for_method_reference)

so that would be

link_to "mylink", { :controller => "mycontroller", :action => "myaction" }, { :class => "myclass" }

becomes

<a href="http://mysite.com/mycontroller/myaction&quot; class="myclass">mylink</a>

i don't see how auto_link has anything to do with his question. he asked about adding a class attribute using link_to

and to answer your question, no. autolink just replaces urls and/or email addresses in a string with the appropriate anchor tag. doesn't matter where the url goes.

auto_link "go here: http://www.yahoo.com and send an email to me@here.com"

translates to

"go here: <a href="http://www.yahoo.com">http://www/yahoo.com&lt;/a&gt; and send an email to <a href="mailto:me@here.com>me@here.com</a>"

link_to "go here" "http://www.yahoo.com"

translates to

"<a href="http://www.yahoo.com">go here<a/>"

there's a difference. one replaces urls and email addresses with anchor tags in a string, the other generates an anchor tag from a name and url (and any options).