O'Reilly logo

Rails, Angular, Postgres, and Bootstrap, 2nd Edition by David B. Copeland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing a Basic Fuzzy Search with Rails

As mentioned in the Introduction, Shine will be sharing a database with an existing customer-facing application. The customer-search feature we’re building will search one of the tables in that database.

In the real world, our database would already exist and you’d hook up to it directly. Since that’s not the case, you’ll need to simulate its existence by creating the table in Shine’s database. And, because you’ll use Postgres query performance optimization, our table is going to need a lot of data in it.

Set Up the New Table and Data

If you were using an existing table, you wouldn’t need a migration—you could just create the Customer model and be done. That’s not the case (since this is an example ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required