New Discussion

Notifications

You’re not receiving notifications from this thread.

ActionText remove attach file button from Trix editor

4
General

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;
}

Thank You

May be old, but I'd missed it. Thanks

Join the discussion
Create an account Log in

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

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

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