简体   繁体   中英

Ruby on Rails ActiveAdmin + TinyMCE error

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 method register_javascript' for # (NoMethodError)

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM