Turbolinks_render

screenshot of Turbolinks_render
rails

Support for `render` with Turbolinks in Rails controllers

Overview

CircleCIturbolinks_render is an innovative gem designed to enhance the integration between Rails controllers and the Turbolinks library. Turbolinks can handle redirect requests seamlessly, but it falls short when it comes to render responses. This gem addresses that limitation by allowing Rails developers to use render within their controllers effectively. By streamlining how form responses are managed, it can save developers time and complexity when dealing with AJAX requests.

With CircleCIturbolinks_render, developers can expect smarter handling of HTML responses, ensuring that the main page elements remain intact during content updates. This functionality not only enhances user experience but also preserves the integrity of the page's JavaScript and CSS.

Features

  • Automatic Turbolinks Rendering: Automatically renders HTML responses using Turbolinks when certain conditions are met, optimizing user interactions.
  • Conditional Behavior: Operates on AJAX requests that are not GET requests, ensuring that the right scenarios trigger the smart content replacement.
  • Head Preservation: Maintains the existing <head> content during updates, minimizing repetitive loading and enhancing performance.
  • Event Dispatching: Dispatches a turbolinks:load event to ensure that any attached JavaScript behaves as expected after the content replacement.
  • Flexible Configuration: Developers can invert the default settings to choose when Turbolinks should be used for rendering, allowing for greater control based on application needs.
  • Path Ignoring: Offers the ability to ignore specific paths, beneficial for applications using engines without direct access to modify render calls.
  • Rack Middleware: Utilizes rack middleware to intercept requests and modify responses, making implementation neat and streamlined.
  • Open Source License: Distributed under the MIT License, granting freedom for developers to use it in their projects.
rails
Ruby on Rails

Ruby on Rails, often referred to as Rails, is an open-source web application framework written in Ruby. Known for its convention over configuration and don't repeat yourself (DRY) principles, Rails simplifies and accelerates the development of database-backed web applications.