Here in Holland our zip code has this format: “1234 AA”. Zip codes are stored in the database as “1234AA” and with the use of a decorator it shows with the space in a view. I have a search field and I want the user to be able to search for “1234 AA” to find zip codes of “1234AA”. How can I create a search scope in the model to do this?
Share
In your controller, where you handle the search-related logic, can’t you just strip the whitespace ?