This file contains hidden or 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/amp/samples/show.amp.erb | |
# write your HTML for AMP page here. |
This file contains hidden or 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/amp/layouts/application.amp.erb | |
<!DOCTYPE html> | |
<html amp lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/> | |
<!-- add/remove ampproject.org scripts as you need it --> | |
<script async src="https://cdn.ampproject.org/v0.js"></script> | |
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script> |
This file contains hidden or 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
<script src="/assets/jquery.js"></script> | |
<script src="/assets/jquery_ujs.js"></script> |
This file contains hidden or 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
- //= jquery_ujs | |
+ //= require rails-ujs |
This file contains hidden or 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
gem "webpacker" |
This file contains hidden or 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/loaders/custom_loaders.js | |
module.exports = { | |
test: /\.ya?ml$/, | |
loaders: ['json-loader', 'yaml-loader'] | |
}; |
This file contains hidden or 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/loaders/erb.js | |
module.exports = { | |
test: /\.erb$/, | |
enforce: 'pre', | |
exclude: /node_modules/, | |
use: [{ | |
loader: 'rails-erb-loader', | |
options: { | |
runner: (/^win/.test(process.platform) ? 'ruby ' : '') + 'bin/rails runner' | |
} |
This file contains hidden or 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/production.js | |
process.env.NODE_ENV = 'production'; | |
const environment = require('./environment'); | |
module.exports = environment.toWebpackConfig(); |
This file contains hidden or 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 */ | |
require("@rails/ujs").start(); | |
require("@rails/activestorage").start(); |
This file contains hidden or 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/example1.js */ | |
var example1 = function doSomething() { | |
// Your codes here | |
} | |
export default example1; |