{"id":18234623,"url":"https://github.com/rails-designer/stealth_dom_id","last_synced_at":"2025-04-11T08:44:53.078Z","repository":{"id":261026883,"uuid":"883050091","full_name":"Rails-Designer/stealth_dom_id","owner":"Rails-Designer","description":"Extends Rails `dom_id` helper to support custom attribute-based identifiers","archived":false,"fork":false,"pushed_at":"2024-11-30T11:30:50.000Z","size":29,"stargazers_count":23,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T10:21:16.817Z","etag":null,"topics":["gem","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rails-Designer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-04T09:42:45.000Z","updated_at":"2025-01-27T15:32:16.000Z","dependencies_parsed_at":"2024-12-24T19:30:36.556Z","dependency_job_id":"3270ea28-2eb9-4a2b-a307-d6d8690c6a9a","html_url":"https://github.com/Rails-Designer/stealth_dom_id","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.2857142857142857,"last_synced_commit":"dca4561926d42010b674fa07af3b62ca4d55f023"},"previous_names":["rails-designer/stealth_dom_id"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rails-Designer%2Fstealth_dom_id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rails-Designer%2Fstealth_dom_id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rails-Designer%2Fstealth_dom_id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rails-Designer%2Fstealth_dom_id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rails-Designer","download_url":"https://codeload.github.com/Rails-Designer/stealth_dom_id/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248362743,"owners_count":21091190,"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":["gem","rails","ruby"],"created_at":"2024-11-04T23:04:25.450Z","updated_at":"2025-04-11T08:44:53.050Z","avatar_url":"https://github.com/Rails-Designer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stealth_dom_id\n\nstealth_dom_id extends Rails' [`dom_id`](https://github.com/rails/rails/blob/main/actionview/lib/action_view/record_identifier.rb) helper to generate DOM IDs using an alternative attribute instead of database primary keys. This helps prevent exposing internal database IDs\n\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n```bash\nbundle add stealth_dom_id\n```\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n```bash\ngem install stealth_dom_id\n```\n\n\n## Usage\n\nThis gem extends Rails' `dom_id` helper to use an alternative attribute instead of exposing database IDs in your HTML elements.\n\nInstead of:\n```erb\n\u003c%= dom_id(@user) %\u003e\n# =\u003e \"user_1\"\n```\n\nYou can use:\n```erb\n\u003c%= dom_id(@user, attribute: :public_id) %\u003e\n# =\u003e \"user_a1b2c3\"\n```\n\n`attribute` is optional, it defaults to the primary_key. Just like with Rails' `dom_id`, the `prefix` attribute is also supported.\n\n```erb\n\u003c%= dom_id(@user, :admin, attribute: :public_id) %\u003e\n# =\u003e \"admin_user_a1b2c3\"\n```\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frails-designer%2Fstealth_dom_id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frails-designer%2Fstealth_dom_id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frails-designer%2Fstealth_dom_id/lists"}