Topic: How to pass CSS class to a view output?
How can I pass a CCS class to this ouput ?
<%= store.address_line_1 %>
I tried several things like: <%= store.address_line_1, :class => :store_manager %>
but not working!
You are not logged in. Please login or register.
Rails Forum - Ruby on Rails Help and Discussion Forum » XHTML/CSS/JavaScript » How to pass CSS class to a view output?
How can I pass a CCS class to this ouput ?
<%= store.address_line_1 %>
I tried several things like: <%= store.address_line_1, :class => :store_manager %>
but not working!
I think you need to manually wrap it in a span tag?
<%= store.address_line_1 %>
# renders in the browser => 123 Main St.there is no 'tag' to add the css class to, so you need to add your html tags manually?
<span class="store_manager">
<%= store.address_line_1 %>
</span>
# renders in the browser => <span class="store_manager">123 Main St.</span>yes i just wanted to pass it in the code because my span class has assigned different values in my css and wanted something diferrent here and <span class="something> does not work cause i declared it in my body span above!
I don't quite understand.
Are you saying that <span class="something"> does not work because you have a css definition for all span tags?
if so you should be able to override that definition, in your css if you have this
span {
font-size: 10px;
}you can still add more specific css class definition
span {
font-size: 10px;
}
span.something {
font-size: 16px;
}Oh! I wasn't aware of that!!
Thank you very much! ![]()
Hosting provided by aTech Media