Redactor looks like an awesome rich text editor. I want to use redactor in a specific text area in my Active Admin CMS.
I found this gem which integrates redactor with rails, and so I tried to set it up:
gemfile:
gem 'redactor-rails'
shell:
$ bundle install
config/redactor.yml
lang: 'en'
autoresize: true
config/initializer/active_admin.rb
config.register_stylesheet 'redactor-rails.css'
config.register_javascript 'redactor-rails.js'
the input in my active admin resource config
f.input :contents, input_html: { id: "redactor_here", class: "redactor" }
I've checked:
In the readme for redactor-rails it says that after creating the textarea, you need to call the redactor
helper to initialize redactor. However, that redactor
helper isn't in the scope of an active admin form.. so where could I call it?
At the moment absolutely nothing is happening in the browser. Any help with this would be greatly appreciated.
Hubble's directions didn't quite work for me, but here's what worked... Follow the directions on the gem's page, then for Active Admin:
In active_admin.js, add
//= require redactor-rails
In active_admin.css.scss, add
@import "redactor-rails";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With