Skip to content

Instantly share code, notes, and snippets.

@benphelps
benphelps / __readme.md
Last active Sep 9, 2020
Action Specific Javascript for Rails 5
View __readme.md

Action Specific Javascript for Rails 5

This is a simple example of action specific javascript. It also allows you to pass data to JS from inside rails controllers. Works with Turbolinks 5 (not required).

Installation

Add the files below to your project, then insert <%= insert_javascript_hook %> somewhere in the footer of your layout.

You'll need these gems:

gem 'jquery-rails'