{"id":15064605,"url":"https://github.com/alexb52/rails-playground","last_synced_at":"2025-04-10T12:41:00.278Z","repository":{"id":56890667,"uuid":"466983473","full_name":"AlexB52/rails-playground","owner":"AlexB52","description":"Access and play with rails console straight from your browser.","archived":false,"fork":false,"pushed_at":"2024-10-16T00:40:32.000Z","size":441,"stargazers_count":11,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T12:37:29.145Z","etag":null,"topics":["playground","query-editor","rails","web-console"],"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/AlexB52.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-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":"2022-03-07T07:14:43.000Z","updated_at":"2024-08-14T00:19:13.000Z","dependencies_parsed_at":"2024-02-26T21:28:41.626Z","dependency_job_id":"d1ef79a1-7ee4-470e-a6c6-03fb687a8339","html_url":"https://github.com/AlexB52/rails-playground","commit_stats":{"total_commits":49,"total_committers":2,"mean_commits":24.5,"dds":0.2857142857142857,"last_synced_commit":"da42ee81bcae47385986357f278dd6cd2c49d05f"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexB52%2Frails-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexB52%2Frails-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexB52%2Frails-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexB52%2Frails-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexB52","download_url":"https://codeload.github.com/AlexB52/rails-playground/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217155,"owners_count":21066634,"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":["playground","query-editor","rails","web-console"],"created_at":"2024-09-25T00:22:25.541Z","updated_at":"2025-04-10T12:41:00.243Z","avatar_url":"https://github.com/AlexB52.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# (Rails) Playground\n\nBack-and-forths from your editor and your rails console is a thing of the past!\n\n![playground-demo](https://user-images.githubusercontent.com/7149034/158045230-3129bf4e-8eeb-4096-9293-04a8c6003bed.gif)\n\n## Features\n\n### Query Editor\n\nInspired by the Go playground and SQL Server Management Studio (SSMS) Query Editor, `rails-playground` is a rails engine that eases experiments with your application domain.\n\n### Script Management\n\nThe gem also comes with a script management tool to help share useful scripts with your teammates. Shared scripts stay close to the code and become more maintainable while personal scripts are git ignored and don't pollute the git history.\n\n## Usage\n\n### Query Editor\n\nThere are three ways to run ruby code in the console:\n\n* Select your code in the editor and press cmd+Enter\n* Put your cursor on any line (no selection) and press cmd+Enter\n* Type your code straight in the terminal box just like in a rails console\n\n### Script Management\n\nAny files under `lib/playground` folder will appear in the sidebar. You can filter them by name from the search input.\n\nSee [Ignoring personal scripts](#ignoring-personal-scripts) to share scripts with your team while ignoring personal scripts.\n\n## Installation\n\n### Query Editor\n\nPlayground is built on top of `web-console` gem. Just like `web-console`, it's only meant to be used in development. Every `web-console` information still holds for `rails-playground`. Check `web-console` [repository for more information](https://github.com/rails/web-console)\n\nAdd this line to your application's Gemfile under the development group:\n\n```ruby\ngroup :development do\n  gem \"rails-playground\", require: \"playground\"\nend\n```\n\n_**Naming issue:** The gem was originally called `playground` but it already exists in RubyGems... Thus the gem is now called `rails-playground` but the functionality remains under the `playground` namespace for now._\n\nAnd then execute:\n```bash\n$ bundle\n```\n\nFinally, mount the engine in your routes file and access the web playground at `/playground` on your localhost.\n\n```ruby\nRails.application.routes.draw do\n  mount Playground::Engine =\u003e \"/playground\" if Rails.env.development?\n  # ...\nend\n```\n\n_Nothing stops you from choosing any relative path. For example, you could switch from `/playground` to `/rails/play`._\n\n### Ignoring personal scripts\n\nAny changes made to ignored scripts won't be recorded in your git history.\nAdding a folder from lib/playground in `.gitignore` will, however, still show in the sidebar.\n**Decide on a convention** with your teammates and commit the path to your `.gitignore`.\n\n**Example**\n\nHere is an example of file structure\n\n* scripts version controlled\n  * lib/playground/shared_script_a.rb\n  * lib/playground/shared_script_b.rb\n  * lib/playground/namespace/shared_script_c.rb\n* scripts ignored\n  * lib/playground/my_scripts/my_script_a.rb\n  * lib/playground/my_scripts/my_script_b.rb\n\n```\n.gitignore\n\n/lib/playground/my_scripts/\n```\n\n```\nmy_app/\n├─ app/\n├─ bin/\n├─ config/\n├─ db/\n├─ lib/\n│  ├─ playground/\n│  │  ├─ namespace/\n│  │  │  ├─ shared_script_c.rb\n│  │  ├─ my_scripts/\n│  │  │  ├─ my_script_a.rb\n│  │  │  ├─ my_script_b.rb\n│  │  ├─ shared_script_a.rb\n│  │  ├─ shared_script_b.rb\n├─ .gitignore\n```\n\n## Troubleshooting\n\n### Session :id is no longer available in memory.\n\nExample:\n```\nSession e96248aec85b3006488c276b9468a4d8 is no longer available in memory.\n\nIf you happen to run on a multi-process server (like Unicorn or Puma) the process\nthis request hit doesn't store e96248aec85b3006488c276b9468a4d8 in memory. Consider turning the number of\nprocesses/workers to one (1) or using a different server in development.\n```\n\nThis is a known `web-console` error that happens when you run a multi-threaded server locally.\nTo solve this problem make sure to set the number of processes/worker to 1 on your local server.\n\n## License\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%2Falexb52%2Frails-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexb52%2Frails-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexb52%2Frails-playground/lists"}