{"id":15412741,"url":"https://github.com/elmassimo/rails-ajax_redirect","last_synced_at":"2026-05-06T07:33:26.146Z","repository":{"id":56890419,"uuid":"48767287","full_name":"ElMassimo/rails-ajax_redirect","owner":"ElMassimo","description":"↩️ Provides redirect support for ajax requests in Rails","archived":false,"fork":false,"pushed_at":"2015-12-29T21:47:59.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T08:59:22.159Z","etag":null,"topics":["ajax-request","rails","redirects","turbolinks"],"latest_commit_sha":null,"homepage":"https://maximomussini.com/posts/rails-ajax_redirect/","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/ElMassimo.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":"2015-12-29T21:09:21.000Z","updated_at":"2019-03-02T16:44:14.000Z","dependencies_parsed_at":"2022-08-20T15:20:42.317Z","dependency_job_id":null,"html_url":"https://github.com/ElMassimo/rails-ajax_redirect","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/ElMassimo%2Frails-ajax_redirect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Frails-ajax_redirect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Frails-ajax_redirect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Frails-ajax_redirect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElMassimo","download_url":"https://codeload.github.com/ElMassimo/rails-ajax_redirect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245960817,"owners_count":20700781,"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":["ajax-request","rails","redirects","turbolinks"],"created_at":"2024-10-01T16:54:14.761Z","updated_at":"2026-05-06T07:33:26.112Z","avatar_url":"https://github.com/ElMassimo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Rails::AjaxRedirect\n=====================\n[![Gem Version](https://badge.fury.io/rb/rails-ajax_redirect.svg)](http://badge.fury.io/rb/rails-ajax_redirect)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ElMassimo/rails-ajax_redirect/blob/master/LICENSE.txt)\n\nSimple `redirect_to` support for AJAX requests in non-Turbolinks applications.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'rails-ajax_redirect'\n\nOr install it yourself as:\n\n    gem install rails-ajax_redirect\n\n## Usage\n\nRequire `rails-ajax_redirect` in your `application.js`:\n\n``` javascript\n//= require rails-ajax_redirect\n```\n\n`AjaxRedirect` extends `redirect_to` to use a custom status code for ajax\nrequests, while still setting the `Location` header.\n\nThe script adds a handler for the `ajax:success` event, that navigates to the\nlocation in the header for responses that have the custom status code.\n\nNow you will be able to write controller actions in the usual way :smiley:\n\n## Turbolinks\n\nIf your application uses Turbolinks check out [`turbolinks-redirect`](https://github.com/remind101/turbolinks-redirect), on which this library is based on. The advantage is that\nit will perform faster navigation by leveraging Turbolinks to visit the new\nlocation.\n\nLicense\n--------\n\n    Copyright (c) 2015 Máximo Mussini\n\n    Permission is hereby granted, free of charge, to any person obtaining\n    a copy of this software and associated documentation files (the\n    \"Software\"), to deal in the Software without restriction, including\n    without limitation the rights to use, copy, modify, merge, publish,\n    distribute, sublicense, and/or sell copies of the Software, and to\n    permit persons to whom the Software is furnished to do so, subject to\n    the following conditions:\n\n    The above copyright notice and this permission notice shall be\n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmassimo%2Frails-ajax_redirect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felmassimo%2Frails-ajax_redirect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmassimo%2Frails-ajax_redirect/lists"}