Answer the question
In order to leave comments, you need to log in
Why is rails not passing data to the database when using mask.input?
There is a form, the form is writing to the database from the user,
I used jquery.maskedinput.js, and in the posts.js.coffee file I indicated
jQuery ->
$('#post_date').datepicker
dateFormat: 'yy-mm-dd'
$("#ssn").mask("99:99");
$("#phone").mask("(999) 999-9999");
<%= f.text_field :phone, :id => "phone", class: "form-control" %>
Answer the question
In order to leave comments, you need to log in
The question was of course noobish... it turned out that the phone field in the database was an integer, changed it to a string and everything worked, I wonder why when using masked input 0 was written to the database, and without it everything was written normally as it should have been...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question