omarArroum
omarArroum

Reputation: 255

Rails `button_to` CSS Styling not working

been trying to style my button_to button, however with no luck. I've had a look in the CSS file and used #button {color:red;}, button {color:red;} and .button {color:red;} but to no avail for all of them. I also have this in my HTML.ERB file <%= button_to 'Compare DB',:action => "compare", :id => 'button' but that doesn't help.

Is there any reason why that doesn't work?

The CSS stylesheet is linked to the Rails app, as I tried changing the value for the table so that's not the issue. Been trying for a while now, still can't figure out the solution.

Upvotes: 1

Views: 4984

Answers (1)

bilash.saha
bilash.saha

Reputation: 7316

You can use style inline

<%= button_to 'Compare DB',:action => "compare", :id => 'button', {:style => "background: color:red; } %> 

or you can use css clas like

<%= button_to 'Compare DB',:action => "compare", :id => 'button', {:class => "button"} %> 

Upvotes: 2

Related Questions