• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Rails 6 webpacker. Js plugins not working

I am using Rails 6. I am having problems with getting js plugins working. I am trying to add toastr.js.

This what I have tried

yarn add toastr 

This is how my application.js file look

require("@rails/ujs").start() require("turbolinks").start() require("@rails/activestorage").start() require("channels") require('bootstrap') require("jquery-ui") require("packs/adminlte") require("bootstrap-datepicker") require("toastr/toastr") 

This is how my environment.js file looks like

const { environment } = require('@rails/webpacker');  const webpack = require('webpack');  environment.plugins.append('Provide', new webpack.ProvidePlugin({     $: 'jquery',     jQuery: 'jquery',     Popper: ['popper.js', 'default'] }));  module.exports = environment; 

If I use cdn or run the js code at toastr/toastr(node modules) in browser console everything works.

What am I missing?

Download script demo [LINK]
Download script demo [LINK 2] Download script demo [LINK 2]