Class: PaperTrailViewer::JsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- PaperTrailViewer::JsController
- Defined in:
- app/controllers/paper_trail_viewer/js_controller.rb
Overview
This returns the pre-compiled JS for the viewer component. Yes, that is a hacky way to make the gem work without forcing users to install and integrate an npm package.
Instance Method Summary collapse
Instance Method Details
#js_file ⇒ Object
11 12 13 |
# File 'app/controllers/paper_trail_viewer/js_controller.rb', line 11 def js_file File.join(__dir__, '..', '..', '..', 'javascript', 'compiled.js') end |
#show ⇒ Object
7 8 9 |
# File 'app/controllers/paper_trail_viewer/js_controller.rb', line 7 def show send_file js_file, type: 'text/javascript', disposition: 'inline' end |