Rails 4, Redactor, ActiveAdmin and Heroku - Quick Fix

Nov 15, 2013 tech Comments

Everything was going swell and I had Redactor up and running locally as my WYSIWYG editor of choice for my Rails 4 app. (If you haven't checked out Redactor yet, I suggest you do so). But what happened when I deployed to Heroku? You know what happened...

Bada boom

Ok, so there was no catastrophic event, but it was confusing to say the least. After a little research and fiddling, my friend @genericsteele and I came up with a simple fix.

First, you should know that Active Admin wants you to include any additional CSS and JavaScript files being used within Active Admin in the active_admin.rb file. This has to do with the way they load their assets. So typically, you would include the redactor.css and redactor.js files there. However, this didn't seem to work. Here's what did:

Solution

Require them in your app/ application.css and application.js files.

Additionally, you can @import the Redactor files if you're using SASS.

So no more big bada boom. Just the awesome feeling that you're not stuck on the same problem anymore!

comments powered by Disqus