I\'m trying to add Froala editor to my project.
Problem only on production server(on localhost it works fine) I\'m using rails 4.1.0 In gemfile i\'m have
<
The following is what I needed to do for Rails 6 (6.0.3.4 to be exact.) [found at (all credit goes to): https://www.botreetechnologies.com/blog/introducing-jquery-in-rails-6-using-webpacker]
Add jQuery to environment.
$ yarn add jquery
Add below code in environment.js (<app_path>/config/webpack/environment.js)
const webpack = require('webpack')
environment.plugins.prepend('Provide',
new webpack.ProvidePlugin({
$: 'jquery/src/jquery',
jQuery: 'jquery/src/jquery'
})
)
Require jquery in application.js file. (/app/javascript/packs/application.js)
require('jquery')
(Restart rails server to make sure everything gets loaded.)