dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-10 03:05 UTC
need to add XTHML class attribute, link_to''s html options?
I need to add a class attribute to the elements generated by link_to for my CSS to style the links. How can I do that? <%= link_to "Artworks", :controller => "artwork", :action => "list" %> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Phlip
2007-Jul-10 03:15 UTC
Re: need to add XTHML class attribute, link_to''s html options?
dangerwillrobinsondanger wrote:> I need to add a class attribute to the elements generated by link_to > for my CSS to style the links. > How can I do that? > > <%= link_to "Artworks", :controller => "artwork", :action => "list" %><%= link_to ''My Homepage'', get_home_page.last, :class => ''navlink3'' %> -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-10 03:56 UTC
Re: need to add XTHML class attribute, link_to''s html options?
Thanks, but that approach using this: <%= link_to "Artworks", :controller => "artwork", :action => "list", :class => "artwork" %> ...generates this: <a href="/artwork/list?class=artwork">Artworks</a> That definitely renders, but renders something different from what I need. I need to generate this: <a href="/artwork/list" class="artwork">Artworks</a> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-10 04:02 UTC
Re: need to add XTHML class attribute, link_to''s html options?
Aha!! I got it! <%= link_to "Artworks", :controller => "artwork", :action => "list", :class => "artwork" %> needs to be: <%= link_to "Artworks", {:controller => "artwork", :action => "list"}, :class => "artwork" %> Voila! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---