config.js in redactor-rails is not reflected

Asked 2 years ago, Updated 2 years ago, 73 views

I want to adjust the min-height of the reductor editor in config.js (I want to have some height in the text area), but it works in a local environment, but when deployed to heroku, the configuration is no longer reflected.

Could you please let me know if you have any idea why the behavior is different between the local environment and the heroku environment?

  • config/initializers/active_admin.rb
config.register_stylesheet 'redactor-rails.css'
  config.register_javascript 'redactor-rails.js'
  • app/assets/javascripts/active_admin.js.coffee
#=require redactor-rails

ruby ruby-on-rails redactor heroku

2022-09-30 20:32

1 Answers

There was a answer in the home SO (original material is this issue on GitHub).
In summary,

Create your own config.js, put it in the asset of the app, and instead of writing #=require redactor-rails,

#=require redactor-rails/redactor.min
#= require path /to/custom/config (path to config.js)

It's good to write

The reason is that the rakeassets:precompile task picks up config.js (the default) in the gem.

The GitHub issue has not been updated for a while, so it seems that it has not been resolved...


2022-09-30 20:32

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.