I have a CSS class called ".form_bg_color" with the following definition:
.form_bg_color{ background: red; }
When I apply this class to my text field in the view like so:
<%= f.text_field :source, class: "form_bg_color" %>
The color of the input box should change, but it doesn't work.
To troubleshoot, I tried changing the form line to:
<%= f.text_field :source, style: "background:red;" %>
This solution worked. Additionally, applying the class to a text area using 'text_area' also works:
<%= f.text_area :source, class: "form_bg_color" %>
Can someone explain why the text_field does not accept my class?