Skip to content

Commit

Permalink
enable UJS
Browse files Browse the repository at this point in the history
  • Loading branch information
amtuannguyen committed Jan 9, 2025
1 parent ec833d1 commit f42df41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/javascript/application.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails

import "bootstrap";
import "jquery";
import "datepicker";

import Rails from '@rails/ujs';
Rails.start();

$(document).ready(function () {
$('.datepicker').datepicker();

Expand Down
1 change: 1 addition & 0 deletions config/importmap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
pin "bootstrap", to: 'bootstrap.min.js', preload: true
pin "jquery", to: "https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.js"
pin "datepicker", to: "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap-datepicker.min.js"
pin "@rails/ujs", to: "https://cdn.skypack.dev/@rails/ujs"

0 comments on commit f42df41

Please sign in to comment.