Ask A Question

Notifications

You’re not receiving notifications from this thread.

Is it possible to remove formatting tools from the ActionText Trix editor?

HP asked in Rails

I looked at both the ActionText and Trix documentation and could not find anything on how to disable/remove formatting tools and disable file uploads for ActionText.

For the project I am working on, I need only text formatting (bold, italic, lists, etc.) but not file uploads and hyperlinks. I considered dealing with hyperlinks via Rails content formatting options (rendering them as text) but was hoping for a bit more elegant approach before going down that route. As for blocking uploads, no idea whether that is possible while also using ActionText.

Has anybody deal with this alredy or does anybody know where I could look up more information?

Thanks in advance.

Reply

I managed to temporarily remove the file upload icon with css.

trix-toolbar .trix-button--icon-attach {
  display: none;
}
Reply

Removing buttons does seem to be easily done with css, but what about adding custom buttons like h1, h2, h3, underline, indent, etc? Seems like ActionText (via Trix) would have some config options to more easily customize the toolbar. I know you can customize (or, build your own) toolbar in Trix...but, how would you do this inside of Rails ActionText?

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,329+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.