Forum: Ruby on Rails how to Apply styles in rhtml

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Prashant T. (Guest)
on 2006-04-05 13:54
Hi,

I am new to RoR environment. I want to apply a class from my stylesheet
to particular button element in my rhtml file. the class in my styesheet
is :-
=======
buttonstyle{
    color: #FFFFFF;
    border-style: solid;
    border-width: 0;
    background-color: #008000
}
=======

We can apply this class in stylesheet to button in HTML as follows:-
==========
<input type="submit" class="buttonstyle">
=============

But same thing I want to achieve inside "  <%= submit_tag "Register" %>"
.
How to do this? That is here I want to add this style only to some
buttons inside my rhtml file . How to do this?

please help me.

Thanx.
Rimantas L. (Guest)
on 2006-04-05 14:09
(Received via mailing list)
> Hi,
>
> I am new to RoR environment. I want to apply a class from my stylesheet
> to particular button element in my rhtml file. the class in my styesheet
<...>
> But same thing I want to achieve inside "  <%= submit_tag "Register" %>"
> .
> How to do this? That is here I want to add this style only to some
> buttons inside my rhtml file . How to do this?

<%= submit_tag "Register", :class => :buttonstyle %>

Regards,
Rimantas
--
http://rimantas.com/
This topic is locked and can not be replied to.