I need to restrict the user from entering the only integer for one of my column with length specification.
<%= f.input :value, as: :numeric, :input_html => { :maxlength => 4 } %>
The above works for string type of field in the UI, but when I add numeric to restrict alphanumeric input, then the max length is not working.
the expectation is to limit the input to 4 char maximum, and it should be positive number input only
If your "value" attribute is an integer you don't need to specify the "as" in simpleform as it will automagically handle that for you:
My personal preference is to use jquery-mask: https://igorescobar.github.io/jQuery-Mask-Plugin/docs.html
In your view you then apply it like (assuming turbolinks wasn't disabled):