{"id":19723526,"url":"https://github.com/remind101/turbolinks-redirect","last_synced_at":"2025-04-29T22:30:59.864Z","repository":{"id":7974669,"uuid":"9376271","full_name":"remind101/turbolinks-redirect","owner":"remind101","description":"Simple redirect_to support for turbolinks and jquery-rails.","archived":false,"fork":false,"pushed_at":"2013-08-17T01:33:56.000Z","size":54,"stargazers_count":9,"open_issues_count":2,"forks_count":4,"subscribers_count":93,"default_branch":"master","last_synced_at":"2025-04-05T20:01:43.790Z","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/remind101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-11T17:33:52.000Z","updated_at":"2018-11-26T07:05:46.000Z","dependencies_parsed_at":"2022-09-10T18:12:43.513Z","dependency_job_id":null,"html_url":"https://github.com/remind101/turbolinks-redirect","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remind101%2Fturbolinks-redirect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remind101%2Fturbolinks-redirect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remind101%2Fturbolinks-redirect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remind101%2Fturbolinks-redirect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remind101","download_url":"https://codeload.github.com/remind101/turbolinks-redirect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251592958,"owners_count":21614449,"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-11-11T23:22:31.137Z","updated_at":"2025-04-29T22:30:59.544Z","avatar_url":"https://github.com/remind101.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Turbolinks::Redirect\n\nSimple `redirect_to` support for [turbolinks][turbolinks] and\n[jquery-rails][jquery-rails].\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'turbolinks-redirect'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install turbolinks-redirect\n\n## Usage\n\nThis approach assumes that you are trying to get turbolinks to play nice\nwith rails_ujs and want your ajax forms to be able to \"redirect\" on success.\n\nSimply require `turbolinks.redirect` in your javascripts:\n\n``` javascript\n//= require turbolinks\n//= require turbolinks.redirect\n```\n\nNow, write your controller actions as you normally would:\n\n``` ruby\nclass PostsController \u003c ActionController::Base\n\n  def create\n    @post = Post.new params[ :post ]\n    if @post.save\n      redirect_to @post\n    else\n      render :new\n    end\n  end\nend\n```\n\nUnder the hood, `redirect_to` checks to see if the request is an XHR. If\nit is, instead of responding with a 3xx status code, it responds with a\ncustom 2xx status code, still setting the Location header.\n\nThen, a handler is attached to the rails_ujs \"ajax:success\" event. It\nchecks for this particular status code, and if it finds it, tells\nturbolinks to visit the page located in the header.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n[turbolinks]: https://github.com/rails/turbolinks/\n[jquery-rails]: https://github.com/rails/jquery-rails\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremind101%2Fturbolinks-redirect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremind101%2Fturbolinks-redirect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremind101%2Fturbolinks-redirect/lists"}