Reputation: 1132
I have an application that uses redactor (a wysiwyg editor) it works perfectly locally, and it also works when I upload it, except the config file, which is located in a subfolder doesent do anything, when pushing to Heroku. I tried precompiling, using:
RAILS_ENV=production bundle exec rake assets:precompile
and
bundle exec rake assets:precompile
I have config.assets.enabled = false
The config.js file, that is not working on Heroku, is included in application.js as redactor-rails/config
What can be the problem ?
Upvotes: 2
Views: 815
Reputation: 1297
Have you added config.js to your local git repository before pushing?
[Edit]
A couple more things to check. Are you using the redactor-rails gem, and if so, is it in your gemfile?
gem 'jquery-rails'
gem 'redactor-rails'
Is your gemfile.lock checked into git?
[Edit 2]
I've now tested this out, and indeed, there's an issue with redactor-rails, which causes custom config to be overwritten by the gem's default.
On the github repo, there is a solution, which I've tested on heroku, and copied here:
rails generate redactor:config
generates the fileapp\assets\redactor-rails\config.js
. This will not work in the asset pipeline correctly as therake assets:precompile
task will still takeconfig.js
from the gem instead of the app (not that it'll work fine in development though). See Overriding backend assets in production environmentThe solution is to create your own config.js (or any file name) and put it anywhere in your >app's assets. Then when requiring redactor, instead of
//= require redactor-rails
, use:
//= require redactor-rails/redactor.min
//= require path/to/custom/config
Works for me. Hope that helps. https://github.com/SammyLin/redactor-rails/issues/16
Upvotes: 6