How to apply class from Stylesheet to "link_to" element?


#1

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


#2

Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#3

=======
< 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 P.
removed_email_address@domain.invalid