R
R
Ruslan Galiev2019-12-12 16:25:52
Ruby on Rails
Ruslan Galiev, 2019-12-12 16:25:52

Rails 6 how to properly install Gentella theme via webpacker?

Hello
I decided to take a closer look at the latest version of 6 rails, in which webpack is already installed as a js collector by default. How to install boostrap or jquery is clear. But I found a simple and free gentelella admin template on the net , and here questions arose. I installed it through yarn, and the dependency was added to package.json

{
  "name": "test-project",
  "private": true,
  "dependencies": {
    "@rails/actioncable": "^6.0.0-alpha",
    "@rails/activestorage": "^6.0.0-alpha",
    "@rails/ujs": "^6.0.0-alpha",
    "@rails/webpacker": "4.2.2",
    "gentelella": "^1.4.0"
  },
  "version": "0.1.0",
  "devDependencies": {
    "webpack-dev-server": "^3.9.0"
  }
}

Further in the file app/javascript/packs/application.js added
require("@rails/ujs").start()
require("@rails/activestorage").start()
require("channels")
require("gentelella")

I made a simple home page, but when it is opened, the problem arises that jquery is not connected. Now the question is: How not to connect all the dependencies manually, they are all in the installed gentelella package in the vendors folder. It turns out they only need to be connected correctly? Tell me how to do it?
I have already tried both require("gentelella/vendors") and require("gentelella/vendors/jquery"). How right?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question