1

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?

  • 1
    Looking at the source code, the file lives inside a ui folder. The import needs to be `@import 'activeadmin/trumbowyg/ui/trumbowyg'` – Adam Cooper Sep 25 '20 at 15:17

1 Answers1

1

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

Neeraj Shukla
  • 1,271
  • 11
  • 13
  • Thanks! I actually did have those two lines. I inserted them in again, but am still getting the error. I'm noticing in the error that there is a period after trumbowyg. Could that be causing the problem? How would I remove it? I did a search for it in Visual Studio Code but could not find a place where it has a period. – Katherine Chalmers Sep 16 '20 at 19:12
  • 1
    Hard to debug this without understanding whole setup. For quick check, you can just download the two files from this folder- https://github.com/blocknotes/activeadmin_trumbowyg/tree/master/app/assets/stylesheets/activeadmin into your app/assets/stylesheets folder. And then import these files directly into your active_admin.scss file, just like any other .scss file, since this seems to be a case of file not found. – Neeraj Shukla Sep 16 '20 at 19:58
  • Thank you SO much! This solved the problem and it worked like a charm in dev. The icons disappeared in production - figuring that one out next. :-) – Katherine Chalmers Sep 17 '20 at 12:36