I am using simple form in my Rails application, i tried to set value and class to a specific input field just like below
<%= f.input :email, :required => true, :autofocus => true, :value => "Email", :class => "myclass" %>
Html output :
but i could not able to see value and class set in the actual html form.
What am i doing wrong?
I'm not using the simple_form plugin for Rails, but as the documentation says you should use the :input_html
attribute for this.
Do the following:
<%= f.input :email, required: true, autofocus: true, input_html: { :value => "Email", class: "myclass" } %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With