{"id":14955773,"url":"https://github.com/tadast/sublime-rails-snippets","last_synced_at":"2025-04-06T14:12:17.875Z","repository":{"id":5689518,"uuid":"6899946","full_name":"tadast/sublime-rails-snippets","owner":"tadast","description":"Sublime Text snippets for the latest Ruby and Rails versions","archived":false,"fork":false,"pushed_at":"2017-04-17T15:08:33.000Z","size":138,"stargazers_count":398,"open_issues_count":4,"forks_count":55,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-30T12:09:50.334Z","etag":null,"topics":["editor-plugin","productivity","rails-snippets","ruby","ruby-on-rails","snippets","sublime-text"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/tadast.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":"2012-11-28T10:04:45.000Z","updated_at":"2025-01-23T23:54:18.000Z","dependencies_parsed_at":"2022-09-24T00:42:06.549Z","dependency_job_id":null,"html_url":"https://github.com/tadast/sublime-rails-snippets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tadast%2Fsublime-rails-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tadast%2Fsublime-rails-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tadast%2Fsublime-rails-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tadast%2Fsublime-rails-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tadast","download_url":"https://codeload.github.com/tadast/sublime-rails-snippets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492557,"owners_count":20947545,"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":["editor-plugin","productivity","rails-snippets","ruby","ruby-on-rails","snippets","sublime-text"],"created_at":"2024-09-24T13:11:46.074Z","updated_at":"2025-04-06T14:12:17.858Z","avatar_url":"https://github.com/tadast.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sublime Text Rails snippets\n\n\u003e :warning: I'll be porting these changes to the [official Sublime Text Rails](https://github.com/sublimehq/Packages) snippets. [Here's how you can help](https://github.com/tadast/sublime-rails-snippets/issues/34)\n\u003e\n\u003e\nThis repo provides up-to-date Ruby and Rails snippets for Sublime Text: it's designed to be used with Ruby \u003e= 2.0 and Rails \u003e= 3. All the snippets can be found in [this cheatsheet](http://tadast.github.com/sublime-rails-snippets) generated by [Snipcheat](https://github.com/tadast/snipcheat).\n\n![class](http://cl.ly/image/023Y2X0P1R2X/class.gif)\n\n![ActiveRecord](http://cl.ly/image/0i0B0M3E1I0A/ar.gif)\n\n![migrations](http://cl.ly/image/342Y2m423Q3O/migration.gif)\n\n# Installation\n\nIf you're using Sublime Text 2, please refer to [older installation instructions](https://github.com/tadast/sublime-rails-snippets/blob/8aa22a211e77e5e48df4522f88726baf60090b2b/README.md#installation).\n\n## From Package Control\n\nThe easiest way to install the snippets is via package control.\n\nHowever this method has a little downside: it adds new snippets but does not remove the old ones. This means that for some snippet triggers e.g. `vp` (validates presence) you'll see a drop-down with two options, not one.\n\nLook for \"Ruby on Rails snippets\" in Package Control. [Here's how to install packages](http://wbond.net/sublime_packages/package_control/usage)\n\n## From Git\n\nThis method replaces the default outdated snippets, but you have to keep it up to date manually by running `git pull` every now and again.\n\nTo install via git:\n\n* First, cd into the ST3 Packages directory\n\n```bash\n➜ # Mac:\n➜ cd ~/Library/Application\\ Support/Sublime\\ Text\\ 3/Packages\n➜ # Linux:\n➜ cd ~/.config/sublime-text-3/Packages/\n```\n\n* Then clone this repo into the folder\n\n```\n➜ ls | grep Rails\n➜ # if there is a `Rails` dir, back it up e.g. archive it and remove the original.\n➜ git clone https://github.com/tadast/sublime-rails-snippets.git Rails\n```\n\nIt is important to clone it into a folder called Rails. Some Sublime plugins have hard-coded dependencies pointing to that path. See troubleshooting.\n\n### Troubleshooting\n\n#### Syntax highlighting doesn't work\n\nYou might need to tell Sublime text to use the `Ruby on Rails syntax` provided by `Ruby on Rails Snippets`. With an `.rb` file open and focused navigate to `View -\u003e Syntax -\u003e Open all with current extension as... -\u003e Ruby on Rails Snippets -\u003e Ruby on Rails`\n\n#### Sublime picks Ruby (not Rails) syntax\n\nYou might need to tell Sublime to prefer Rails over Ruby by navigating to\n`View -\u003e Syntax -\u003e Open all with current extension as...` and picking `Rails` of Ruby on Rails snippets\n\n#### Can't find *.tmLanguage\n\nIf Sublime complains it can't find `Ruby on Rails.tmLanguage`, chances are you are using [this hack](https://gist.github.com/925008).\n\nYou'll need to change the path where it looks for that file. Here's the [forked version which works with this plug-in](https://gist.github.com/4161901).\n\nYou may also need to change `Packages/(DetectSyntax|User)/DetectSyntax.sublime-settings` to replace/include this rule\n\n```json\n{\n  \"name\": \"Ruby on Rails snippets/Ruby Haml\",\n  \"rules\": [\n    {\"file_name\": \".*\\\\.haml$\"}\n  ]\n},\n{\n  \"name\": \"Ruby on Rails snippets/Ruby on Rails\",\n  \"rules\": [\n    {\"function\": {\"name\": \"is_rails_file\"}}\n  ]\n}\n```\n\n`Ruby on Rails snippets` is a default installation directory for Package Control.\nIf you installed in a different directory, change the path accordingly\n\n\n# How to contribute\n\n1. Fork it\n2. Create your feature branch for each group of snippet changes that could be merged individually (`git checkout -b my-new-snippet`)\n3. Commit your changes (`git commit -am 'Add some snippet [tab_trigger]'`)\n4. Commit messages should start with a verb in present simple tense and have all affected tab triggers in square brackets e.g. \"Add a snippets for partial rendering [rpc, rpo]\"\n5. Push to the branch (`git push origin my-new-snippet`)\n6. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftadast%2Fsublime-rails-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftadast%2Fsublime-rails-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftadast%2Fsublime-rails-snippets/lists"}