For example: <a class="example_class" href="http://www.example.com">www.example.com</a> Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Bontina Chen wrote:> For example: > > <a class="example_class" > href="http://www.example.com">www.example.com</a> > > Thankshttp://www.rubyonrails.org/api/classes/ActionView/Helpers/TextHelper.html#M000621 Something like: autolink "Come to htttp://www.example.com", href_options = {:class => "example_class"} or autolink "Come to htttp://www.example.com", href_options {class="example_class"} Haven''t really tried. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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" class="myclass">mylink</a> On 1/24/07, Spiken <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Bontina Chen wrote: > > For example: > > > > <a class="example_class" > > href="http://www.example.com">www.example.com</a> > > > > Thanks > > http://www.rubyonrails.org/api/classes/ActionView/Helpers/TextHelper.html#M000621 > > Something like: > autolink "Come to htttp://www.example.com", href_options = {:class => > "example_class"} > > or > > autolink "Come to htttp://www.example.com", href_options > {class="example_class"} > > Haven''t really tried. > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Hall wrote:> 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" > class="myclass">mylink</a>But you still need to use auto_link (auto_link_urls), when it''s an external link, right? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. On 1/24/07, Spiken <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Chris Hall wrote: > > 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" > > class="myclass">mylink</a> > > But you still need to use auto_link (auto_link_urls), when it''s an > external link, right? > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Hall wrote:> 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.Can you use link_to when you want to link to an external site at all? http://www.imdb.com/bestmovieever/img/2.jpg ? That''s why I used auto_link, filters through and makes a link of http://whatever. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
auto_link "go here: http://www.yahoo.com and send an email to me-d1FEnVXDQDs@public.gmane.org" translates to "go here: <a href="http://www.yahoo.com">http://www/yahoo.com</a> and send an email to <a href="mailto:me-d1FEnVXDQDs@public.gmane.org>me-d1FEnVXDQDs@public.gmane.org</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). On 1/24/07, Spiken <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Chris Hall wrote: > > 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. > > Can you use link_to when you want to link to an external site at all? > http://www.imdb.com/bestmovieever/img/2.jpg ? That''s why I used > auto_link, filters through and makes a link of http://whatever. > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---