ActionText remove attach file button from Trix editor
Is there a way to prevent the attach file button in the trix editor for ActionText? I mainly want the formatting ability for things like bold, italics, number lists, etc. But do not want the attach file and if possible would like to only allow certain users to be able to insert links
This would be a good one for the Rails github issue tracker.
I would bet they don't have that by default, but could probably be done by pasting the Rails source into your app, editing the toolbar for Trix, and then including your modified copy instead of the Rails JS for it.
I know this is old but you can add an event listener in application.js
:
document.addEventListener("trix-file-accept", (e) => {
e.preventDefault()
})
and then target the UI with CSS in application.scss
:
.trix-button-group--file-tools {
display: none !important;
}