ruby-on-railstrumbowyg

Active Admin Trumbowyg @import not found error in Rails app


I'm trying to add the Trumbowyg WYSIWYG editor to a rails app using Active admin using this gem.

The instructions seem clear, but I'm getting the following error for the scss import:

SassC::SyntaxError at /admin/messages/new  
Error: File to import not found or unreadable:  
 activeadmin/trumbowyg/trumbowyg.      
        on line 16 of app/assets/stylesheets/active_admin.scss      
>> @import 'activeadmin/trumbowyg/trumbowyg';    

I tried removing the import line. This allowed the app to load, but of course the editor tools did not appear.

Could anyone please suggest a way to fix this?


Solution

  • You have most probably missed importing Active Admin JS files in the app/assets/javascripts/active_admin.js file. As it mentions on the gem's page that you have linked. Just add these lines to the above file-

    //= require activeadmin/trumbowyg/trumbowyg //= require activeadmin/trumbowyg_input