I am using simple-form gem to render my forms. I am trying to set the input field type to 'number'. This code is not working:
f.input :amount, input_html: { type: 'number' }
What is the proper way to set this up?
The following should work
f.input :amount, input_html: { type: 'number' }
An even cleaner way would be:
f.input :amount, as: :numeric
Hope it helps !
Simplest method:
f.input :whatever, as: :numeric
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