{"id":13513720,"url":"https://github.com/josh/rails-behaviors","last_synced_at":"2025-03-31T02:32:54.375Z","repository":{"id":1759992,"uuid":"2654975","full_name":"josh/rails-behaviors","owner":"josh","description":"Rails UJS Behaviors for jQuery and Zepto","archived":true,"fork":false,"pushed_at":"2015-06-05T16:39:40.000Z","size":1028,"stargazers_count":270,"open_issues_count":0,"forks_count":18,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-09T22:35:59.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://josh.github.com/rails-behaviors/","language":"CoffeeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"fsouza/go-dockerclient","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/josh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-27T00:38:48.000Z","updated_at":"2024-09-21T18:00:35.000Z","dependencies_parsed_at":"2022-09-10T10:28:03.217Z","dependency_job_id":null,"html_url":"https://github.com/josh/rails-behaviors","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josh%2Frails-behaviors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josh%2Frails-behaviors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josh%2Frails-behaviors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josh%2Frails-behaviors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/josh","download_url":"https://codeload.github.com/josh/rails-behaviors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222615147,"owners_count":17012022,"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":[],"created_at":"2024-08-01T05:00:36.457Z","updated_at":"2024-11-01T17:30:38.347Z","avatar_url":"https://github.com/josh.png","language":"CoffeeScript","funding_links":[],"categories":["CoffeeScript"],"sub_categories":[],"readme":"# Rails Behaviors (Deprecated)\n\nRails Behaviors implements the `data-*` behaviors generated by Rails 3.x.\n\nThis is an alternative to [jquery-ujs](https://github.com/rails/jquery-ujs). First, it is all CoffeeScript goodness — well, that's mostly good for me! Second, it is written in a modular fashion. This makes it possible to cherry pick the components you need and replace specific functionaly without having to rewrite the entire library. Third, it uses built-in global ajax events rather than adding its own. O, one more thing, **Zepto**.\n\n\n## Dependencies\n\n**jQuery 1.7.2+** or **Zepto 0.8+**\n\nYou'll need [Sprockets 2](https://github.com/sstephenson/sprockets) if you want to use the gem version.\n\n\n## Installation\n\nrails-behaviors is distributed through the [bower](https://github.com/twitter/bower) package manager.\n\n``` bash\nbower install rails-behaviors\n```\n\n## Testing\n\nFor testing you will need:\n\n* Ruby 1.9.3+\n* Bundler (`gem install bundler`)\n\n``` bash\nbundle install\nbundle exec rackup -E test ./test/config.ru\n# now open the browser at http://localhost:9292\n```\n\n## Migrating from jquery-ujs\n\nThis library handles all the `data-*` behaviors defined in Rails, so it is roughly feature for feature identicial in your Views.\n\nThe differences are in the JavaScript.\n\n1. There are no `ajax:*` events. jQuery already has global ajax events built in, so there is no point in duplicating that functionality. Doing a find and replace for `\"ajax:\"` events should give you a good start. You're looking to replace `ajax:success` with `ajaxSuccess`, `ajax:error` with `ajaxError`, etc.\n2. There are no global configuration options. Theres no equivalent for `$.rails`. You probably should have never used that in the first place.\n\n**NOTE:** You **cannot** use `rails-behaviors` and `jquery-ujs` at the same time.\n\n\n## Reference\n\nSee [josh.github.com/rails-behaviors](http://josh.github.com/rails-behaviors/) for a markup and event reference.\n\n## Contributing\n\nSetup:\n\n    $ git clone git://github.com/josh/rails-behaviors.git\n    $ cd rails-behaviors/\n    $ bundle install\n\nRun tests:\n\n    $ rackup -p 3000 test/config.ru\n    $ open http://localhost:3000/\n\n## License\n\nCopyright \u0026copy; 2011 Joshua Peek \u003c\u003cjosh@joshpeek.com\u003e\u003e\n\nRails Behaviors is distributed under an MIT-style license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosh%2Frails-behaviors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosh%2Frails-behaviors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosh%2Frails-behaviors/lists"}