Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hotwired/turbo-rails

Package Overview
Dependencies
Maintainers
4
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hotwired/turbo-rails

The speed of a single-page web application without having to write any JavaScript

  • 8.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
276K
increased by1.28%
Maintainers
4
Weekly downloads
 
Created

What is @hotwired/turbo-rails?

@hotwired/turbo-rails is a package that integrates Turbo, a part of the Hotwire framework, with Ruby on Rails applications. Turbo is designed to speed up web applications by reducing the need for full page reloads and enabling partial updates to the DOM. It provides tools for handling navigation, form submissions, and real-time updates efficiently.

What are @hotwired/turbo-rails's main functionalities?

Turbo Drive

Turbo Drive makes navigation faster by using AJAX to load new pages and update the DOM without a full page reload. This event listener logs a message when Turbo Drive is enabled.

document.addEventListener('turbo:load', () => { console.log('Turbo Drive is enabled!'); });

Turbo Frames

Turbo Frames allow you to update only a portion of the page by loading content into a specific frame. This example shows how to define a Turbo Frame that loads content from a specified source.

<turbo-frame id="frame_id" src="/path/to/content"></turbo-frame>

Turbo Streams

Turbo Streams enable real-time updates to the DOM by defining actions like append, prepend, replace, etc. This example appends a new message to the target element with the ID 'messages'.

<turbo-stream action="append" target="messages"><template><div>New message</div></template></turbo-stream>

Turbo Forms

Turbo Forms enhance form submissions by handling them via AJAX, allowing for partial page updates. This example shows a form that will be submitted using Turbo.

<form data-turbo="true" action="/submit" method="post"><input type="text" name="name"><button type="submit">Submit</button></form>

Other packages similar to @hotwired/turbo-rails

Keywords

FAQs

Package last updated on 13 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc