Answer the question
In order to leave comments, you need to log in
How to find something from the database in Ruby on Rails by removing the signs when checking?
For example, there is a string that I want to find in the database:
And in the database there is the same number, but only in this way: 8(960)410-10-10.
LIKE doesn't help.
How can you find it in this case? number = '89604101010'
Answer the question
In order to leave comments, you need to log in
you need to immediately store in the database as 9604101010 as an integer and display it as +7(xxx)xxx-xx-xx or in another format in which you need.
You need to create a field or index (if the DBMS supports an index by function) with a calculated value of . And already search for it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question