Last active
May 3, 2018 09:00
-
-
Save guillaumecabanel/703d53b7cddc0f36f8bd0f0242d4e257 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ app/views/layouts/application.html.slim | |
doctype html | |
html | |
head | |
meta charset="UTF-8" | |
meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" | |
title title | |
= favicon_link_tag 'favicon.png' | |
= csrf_meta_tags | |
= action_cable_meta_tag | |
= stylesheet_link_tag 'application', media: 'all' | |
/ Uncomment the next line if you import CSS in app/javascript/packs/application.js | |
= stylesheet_pack_tag 'application' | |
body | |
= yield | |
= javascript_include_tag 'application' | |
= javascript_pack_tag 'application' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/javascript/packs/application.js | |
import "bootstrap"; | |
import "../plugins/flatpickr"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// config/webpack/environment.js | |
const { environment } = require('@rails/webpacker') | |
// Bootstrap 3 has a dependency over jQuery: | |
const webpack = require('webpack') | |
environment.plugins.prepend('Provide', | |
new webpack.ProvidePlugin({ | |
$: 'jquery', | |
jQuery: 'jquery' | |
}) | |
) | |
module.exports = environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/javascript/plugins/flatpickr.js | |
import flatpickr from "flatpickr"; | |
import "flatpickr/dist/flatpickr.min.css"; | |
flatpickr('.datepicker', {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "name", | |
"private": true, | |
"dependencies": { | |
"@rails/webpacker": "3.4", | |
"bootstrap": "3", | |
"flatpickr": "^4.4.4", | |
"jquery": "^3.3.1" | |
}, | |
"devDependencies": { | |
"webpack-dev-server": "2.11.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment