I have a rails text_field_tag which i want to input a pattern to only allow numbers and allow numbers max to 100 but somehow nothing is working. I can still input characters and text
My code below
<%= text_field_tag "loan_application[kyc_answer_attributes][share_margin]", @decoded_self_evaluation.try(:loan_application).try(:kyc_answer).try(:share_margin), placeholder: 'Max 100%', class: 'text-center', pattern: '\d*[0-9]\.\d*[0-9]' %>
It looks as seen on tutorials and all but it doesnt seem to work not sure what i am missing.
Any help is greatly appreciated