{"id":13878286,"url":"https://github.com/marcoroth/turbo-ruby","last_synced_at":"2025-04-15T22:49:30.694Z","repository":{"id":65185920,"uuid":"585972715","full_name":"marcoroth/turbo-ruby","owner":"marcoroth","description":"Turbo helpers without the requirement for Rails","archived":false,"fork":false,"pushed_at":"2023-01-10T11:48:04.000Z","size":33,"stargazers_count":45,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T03:32:13.684Z","etag":null,"topics":["hotwire","phlex","rails","turbo"],"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/marcoroth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-06T15:40:11.000Z","updated_at":"2024-08-24T20:05:44.000Z","dependencies_parsed_at":"2023-01-12T11:30:41.997Z","dependency_job_id":null,"html_url":"https://github.com/marcoroth/turbo-ruby","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fturbo-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fturbo-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fturbo-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fturbo-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcoroth","download_url":"https://codeload.github.com/marcoroth/turbo-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248722168,"owners_count":21151211,"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":["hotwire","phlex","rails","turbo"],"created_at":"2024-08-06T08:01:45.222Z","updated_at":"2025-04-15T22:49:30.675Z","avatar_url":"https://github.com/marcoroth.png","language":"Ruby","readme":"# Turbo::Ruby\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add turbo-ruby\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install turbo-ruby\n\n## Note: Usage in Rails\n\nIn order to use `turbo-ruby` in Rails with the Rails `render` method you have to install the `phlex-rails` gem in your app. \n\n### Regular Element\n\n```ruby\n# Ruby\nTurbo::Elements::TurboStream.new(action: \"console_log\", message: \"Hello World\").to_html\n```\n\n```html+erb\n\u003c!-- Rails --\u003e\n\u003c%= render Turbo::Elements::TurboStream.new(action: \"console_log\", message: \"Hello World\") %\u003e\n```\n\n\n\n### Blocks\n\n```ruby\n# Ruby\nTurbo::Elements::TurboStream.new(action: \"morph\", target: \"post_1\") do\n  %(\u003cdiv id=\"post_id\"\u003e\n      \u003ch1\u003ePost 1\u003c/h1\u003e\n    \u003c/div\u003e)\nend.to_html\n```\n\n```html+erb\n\u003c!-- Rails --\u003e\n\u003c%= render Turbo::Elements::TurboStream.new(action: \"morph\", target: \"post_1\") do %\u003e\n  \u003cdiv id=\"post_id\"\u003e\n    \u003ch1\u003ePost 1\u003c/h1\u003e\n  \u003c/div\u003e\n\u003c% end %\u003e\n```\n\n### Partials (Rails only)\n\n```html+erb\n\u003c!-- Rails --\u003e\n\u003c%= render Turbo::Elements::TurboStream.new(action: \"morph\", target: \"post_1\", view_context: self, partial: \"posts/post\", locals: { post: @post } %\u003e\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`. 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/marcoroth/turbo-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/marcoroth/turbo-ruby/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Turbo::Ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/marcoroth/turbo-ruby/blob/main/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":["Ruby","**Awesome Hotwire** [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)"],"sub_categories":["Turbo"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoroth%2Fturbo-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcoroth%2Fturbo-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoroth%2Fturbo-ruby/lists"}