kreativgebiet/rich

Overriding default editor CSS filename is not possible with sprockets-rails

Opened this issue · 0 comments

Hello everyone.

The problem:
when I try to override editor contentsCss option to something non-default it doesn't go through sprockets properly. E.g.:

#config/initializers/rich.rb
.....
config.editor[:contentsCss] = ActionController::Base.helpers.stylesheet_path('rich/custom.css') 
# => '/stylesheets/rich/custom.css'.  expected '/assets/rich/custom-longhash.css'

The root of the problem: sprockets-rails adds digesting in "after_initialize" block so there is no digesting in initializers.

Am I missing something?

Possible solutions:

  1. in Rich.options always pass contentsCss option to assets pipeline, not only when contentsCss == :default
  2. Allow to pass a block in contentsCss option in initializer and call it in Rich.options.