How to insert class name with link_to

link_to(name, options = {}, html_options = nil,

so that would be

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


<a href="" 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: and send an email to"

translates to

"go here: <a href="">http://www/</a> and
send an email to <a href="></a>"

link_to "go here" ""

translates to

"<a href="">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).