Prashant Tiwari
2006-Apr-04 06:36 UTC
[Rails] How to apply class from Stylesheet to "link_to" element???
Hi, This is the "img" class for anchor element inside my stylesheet. ====================A.img:link { color: #ffffff; text-decoration: none; } A.img:visited { color: #ffffff; text-decoration: none; } =====================I can easily apply this tag inside my html document as follows:- ======< a href="goodbye.html" class="img"> ======Now I want to apply this stylesheet class (img) to following link_to tag of rHtml. How to this?? <%= link_to "GoodBye!", :action => "goodbye" %> == Please help me . Thanx in advance. Prash -- Posted via http://www.ruby-forum.com/.
Mats Lindblad
2006-Apr-04 07:34 UTC
[Rails] How to apply class from Stylesheet to "link_to" element???
Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 250 bytes Desc: OpenPGP digital signature Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060404/57c9b4f3/signature.bin
Gustav Paul
2006-Apr-04 11:28 UTC
[Rails] Re: How to apply class from Stylesheet to "link_to" element?
> ======> < a href="goodbye.html" class="img"> > <%= link_to "GoodBye!", :action => "goodbye" %> > > ==Try...<%= link_to "GoodBye!", {:action => ''goodbye''}, {:class => ''img''} %> Braces are optional if all the following parameters are part of the unbraced hash...in this case, :class doesn''t belong in the same hash as the url_for parameters, so you have to explicitly tell ERb where the hashes start and end... Hope it helps! Gustav Paul gustav@psychohistorian.org -- Posted via http://www.ruby-forum.com/.