Skip to content

Instantly share code, notes, and snippets.

View pendechosen's full-sized avatar

Pendechosen pendechosen

View GitHub Profile
@benphelps
benphelps / __readme.md
Last active September 9, 2020 22:14
Action Specific Javascript for Rails 5

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'