{"id":15588362,"url":"https://github.com/ryanckulp/customer_autocomplete_demo","last_synced_at":"2026-02-02T22:19:35.454Z","repository":{"id":39499281,"uuid":"193788929","full_name":"ryanckulp/customer_autocomplete_demo","owner":"ryanckulp","description":"query a table of records in style","archived":false,"fork":false,"pushed_at":"2023-01-19T13:30:56.000Z","size":697,"stargazers_count":0,"open_issues_count":33,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T09:24:21.878Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanckulp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-25T21:59:40.000Z","updated_at":"2023-01-31T17:22:33.000Z","dependencies_parsed_at":"2023-02-11T01:45:34.875Z","dependency_job_id":null,"html_url":"https://github.com/ryanckulp/customer_autocomplete_demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ryanckulp/customer_autocomplete_demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanckulp%2Fcustomer_autocomplete_demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanckulp%2Fcustomer_autocomplete_demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanckulp%2Fcustomer_autocomplete_demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanckulp%2Fcustomer_autocomplete_demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanckulp","download_url":"https://codeload.github.com/ryanckulp/customer_autocomplete_demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanckulp%2Fcustomer_autocomplete_demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262953644,"owners_count":23390238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T22:23:05.287Z","updated_at":"2026-02-02T22:19:30.435Z","avatar_url":"https://github.com/ryanckulp.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Customer Autocomplete Demo\n\nquery a database table of Customers by first name, email, etc.\n\n### installation\n\n1. git clone `https://github.com/ryanckulp/customer_autocomplete_demo.git`\n1. bundle (might need to install ruby version via `rbenv install 2.6.1` first)\n3. `rails db:create \u0026\u0026 rails db:migrate \u0026\u0026 rails db:seed`\n4. `rails s` then visit localhost:3000 and try it\n\n### how it works\n\n1. `keyup` JS listener on the input field pings search via `/customer_searches/new?query=X`\n2. controller delegates search query to `Customer.search()`\n3. `Customer.search()` performs case-insensitive search for \"first_name\" attribute only\n\n### extensions\n\ncan include email address, last name, etc attributes in search parameters via modifications like...\n\n```ruby\ndef self.search(params)\n  results = where(\"first_name ILIKE '%#{params[:query]}%'\")\n  results += where(\"last_name ILIKE '%#{params[:query]}%'\")\n  results += where(\"email ILIKE '%#{params[:query]}%'\")\n\n  results.uniq.map { |c| { id: c.id, full_name: c.full_name } }\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanckulp%2Fcustomer_autocomplete_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanckulp%2Fcustomer_autocomplete_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanckulp%2Fcustomer_autocomplete_demo/lists"}