Ruby on Rails ActiveAdmin + TinyMCE error

260 views Asked by At

I was following the guide I found online to put ActiveAdmin and TinyMCE together into use, but I encountered a strange error which I was not able to search up the solution for it.

One part of it was to add in this line to config/initializers/active_admin.rb:

config.register_javascript 'tinymce.js'

However, when I try to run the app, an error says:

/Users/RageBill/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-5ebf476abd92/lib/active_admin/application.rb:49:in method_missing': undefined methodregister_javascript' for # (NoMethodError)

Any thoughts on how can I resolve this problem? Thank you very much :)

(P.S. my rails version is 5.1.3 if that would be helpful.)

1

There are 1 answers

0
Nenad Miloradovic On

I found: https://github.com/activeadmin/activeadmin/issues/340

This sholud work:

ActiveAdmin.setup do |config|

  config.register_stylesheet "//cdn.foo.net/example.css"

  config.register_javascript "//cdn.foo.net/example.js"

 # ...
end