{"id":19474566,"url":"https://github.com/tomasc/stimulus_helpers","last_synced_at":"2026-06-06T23:31:44.916Z","repository":{"id":142764631,"uuid":"610649399","full_name":"tomasc/stimulus_helpers","owner":"tomasc","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-02T14:34:46.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-14T00:46:13.183Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomasc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2023-03-07T07:47:20.000Z","updated_at":"2025-06-02T14:34:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"fca95538-4633-4b65-a664-793df5a18642","html_url":"https://github.com/tomasc/stimulus_helpers","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tomasc/stimulus_helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fstimulus_helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fstimulus_helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fstimulus_helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fstimulus_helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasc","download_url":"https://codeload.github.com/tomasc/stimulus_helpers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasc%2Fstimulus_helpers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285152377,"owners_count":27123462,"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","status":"online","status_checked_at":"2025-11-18T02:00:05.759Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-10T19:25:41.959Z","updated_at":"2025-11-18T23:05:01.724Z","avatar_url":"https://github.com/tomasc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StimulusHelpers\n\n[![StimulusHelpers](https://github.com/tomasc/stimulus_helpers/actions/workflows/ruby.yml/badge.svg)](https://github.com/tomasc/stimulus_helpers/actions/workflows/ruby.yml)\n\nHelpers to build stimulus controller attributes for use in views and controller-names.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add stimulus_helpers\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install stimulus_helpers\n\n## Usage\n\nSimply include the `StimulusHelpers` module:\n\n```ruby\nclass MyClass\n  include StimulusHelpers\nend\n\n# or\n\nActionView::Base.send :include, StimulusHelpers\n\n# etc.\n```\n\nThis will add the following helpers:\n\nController:\n\n```ruby\nstimulus_controller(\"controller-name\")\n# =\u003e { \"controller\" =\u003e \"controller-name\" }\n```\n\nAction:\n\n```ruby\nstimulus_action(\"controller-name\", \"click\", \"open\")\n# =\u003e { \"action\" =\u003e \"click-\u003econtroller-name#open\" }\n\nstimulus_actions(\"controller-name\", click: \"open\", blur: \"close\")\n# =\u003e { \"action\" =\u003e \"click-\u003econtroller-name#open blur-\u003econtroller-name#close\" }\n```\n\nClass:\n\n```ruby\nstimulus_class(\"controller-name\", \"open\", \"controller-name--open\")\n# =\u003e { \"controller-name-open-class\" =\u003e \"controller-name--open\" }\n\nstimulus_classes(\"controller-name\", open: \"controller-name--open\", closed: \"controller-name--closed\")\n# =\u003e { \"controller-name-open-class\" =\u003e \"controller-name--open\", \"controller-name-closed-class\" =\u003e \"controller-name--closed\" }\n```\n\nValue:\n\n```ruby\nstimulus_value(\"controller-name\", \"open\", true)\n# =\u003e { \"controller-name-open-value\" =\u003e \"true\" }\n\nstimulus_values(\"controller-name\", user: { name: \"Jens\" }, names: [\"foo\", \"bar\"])\n# =\u003e { \"controller-name-user-value\" =\u003e \"{\\\"name\\\":\\\"Jens\\\"}\", \"controller-name-names-value\" =\u003e \"[\\\"foo\\\",\\\"bar\\\"]\" }\n```\n\nTarget:\n\n```ruby\nstimulus_target(\"controller-name\", :input)\n# =\u003e { \"controller-name-target\" =\u003e \"input\" }\n```\n\nParam:\n\n```ruby\nstimulus_param(\"controller-name\", \"id\", 123)\n# =\u003e { \"controller-name-id-param\" =\u003e \"123\" }\n\nstimulus_params(\"controller-name\", id: 123, name: \"Jens\")\n# =\u003e { \"controller-name-id-param\" =\u003e \"123\", \"controller-name-name-param\" =\u003e \"Jens\" }\n```\n\nOutlet:\n\n```ruby\nstimulus_outlet(\"controller-name\", \"result\", \".result\")\n# =\u003e { \"controller-name-result-outlet\" =\u003e \".result\" }\n\nstimulus_outlets(\"controller-name\", result: \".result\", output: \".output\")\n# =\u003e { \"controller-name-result-outlet\" =\u003e \".result\", \"controller-name-output-outlet\" =\u003e \".output\" }\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. 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`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/tomasc/stimulus_helpers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasc%2Fstimulus_helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasc%2Fstimulus_helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasc%2Fstimulus_helpers/lists"}