From 6731a7c97aa8e9e14ef7347a8774bb303a7220e8 Mon Sep 17 00:00:00 2001 From: Canan Date: Thu, 14 May 2020 00:57:14 +0300 Subject: [PATCH] Add fomantic-ui-sass gem and jquery --- Gemfile | 1 + Gemfile.lock | 10 ++++++++++ app/assets/config/manifest.js | 1 + app/assets/stylesheets/application.css | 2 +- app/assets/stylesheets/custom.css.scss | 1 + app/javascript/packs/application.js | 1 + config/webpack/environment.js | 8 ++++++++ package.json | 1 + yarn.lock | 5 +++++ 9 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 app/assets/stylesheets/custom.css.scss diff --git a/Gemfile b/Gemfile index 44c50dc..6efcb41 100644 --- a/Gemfile +++ b/Gemfile @@ -18,6 +18,7 @@ gem 'jbuilder', '~> 2.7' gem 'rename' gem 'awesome_print', '1.8.0' gem 'devise' +gem 'fomantic-ui-sass' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use Active Model has_secure_password diff --git a/Gemfile.lock b/Gemfile.lock index 753df67..8819904 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,6 +58,8 @@ GEM zeitwerk (~> 2.2, >= 2.2.2) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) + autoprefixer-rails (9.7.6) + execjs awesome_print (1.8.0) bcrypt (3.1.13) bindex (0.8.1) @@ -83,7 +85,14 @@ GEM responders warden (~> 1.2.3) erubi (1.9.0) + execjs (2.7.0) ffi (1.12.2) + fomantic-ui-sass (2.8.3) + autoprefixer-rails + rails (>= 3.2.0) + sassc (>= 2.2) + sassc-rails (>= 2.1) + sprockets-rails (>= 2.1.3) globalid (0.4.2) activesupport (>= 4.2.0) i18n (1.8.2) @@ -224,6 +233,7 @@ DEPENDENCIES byebug capybara (>= 2.15) devise + fomantic-ui-sass jbuilder (~> 2.7) listen (>= 3.0.5, < 3.2) pg diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 5918193..526fd69 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,2 +1,3 @@ //= link_tree ../images //= link_directory ../stylesheets .css +//= require semantic-ui diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index d05ea0f..216b3f0 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -12,4 +12,4 @@ * *= require_tree . *= require_self - */ + */ \ No newline at end of file diff --git a/app/assets/stylesheets/custom.css.scss b/app/assets/stylesheets/custom.css.scss new file mode 100644 index 0000000..2585542 --- /dev/null +++ b/app/assets/stylesheets/custom.css.scss @@ -0,0 +1 @@ +@import "semantic-ui"; \ No newline at end of file diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 9cd55d4..7307657 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -7,6 +7,7 @@ require("@rails/ujs").start() require("turbolinks").start() require("@rails/activestorage").start() require("channels") +require('jquery') // Uncomment to copy all static images under ../images to the output folder and reference diff --git a/config/webpack/environment.js b/config/webpack/environment.js index d16d9af..09ec75f 100644 --- a/config/webpack/environment.js +++ b/config/webpack/environment.js @@ -1,3 +1,11 @@ const { environment } = require('@rails/webpacker') +const webpack = require('webpack') +environment.plugins.prepend('Provide', + new webpack.ProvidePlugin({ + $: 'jquery/src/jquery', + jQuery: 'jquery/src/jquery' + }) +) + module.exports = environment diff --git a/package.json b/package.json index 08f23e2..8ae54ff 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "@rails/activestorage": "^6.0.0", "@rails/ujs": "^6.0.0", "@rails/webpacker": "4.2.2", + "jquery": "^3.5.1", "turbolinks": "^5.2.0" }, "version": "0.1.0", diff --git a/yarn.lock b/yarn.lock index 27ab370..4f31104 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3841,6 +3841,11 @@ jest-worker@^25.4.0: merge-stream "^2.0.0" supports-color "^7.0.0" +jquery@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.1.tgz#d7b4d08e1bfdb86ad2f1a3d039ea17304717abb5" + integrity sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg== + js-base64@^2.1.8: version "2.5.2" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.2.tgz#313b6274dda718f714d00b3330bbae6e38e90209"