Adding File Validation to Lexxy Editor with Stimulus
19-Sep-2025 878
A simple Stimulus controller to validate attachments in the Lexxy editor — restricting file types and sizes before they get uploaded.When using Lexxy as a text editor, one thing I wanted was more control over which files users could attach. For example, I didn’t want people to upload huge videos or unsupported formats.
Since my Rails app already uses Stimulus, I wrote a small controller that listens to Lexxy’s file-accept event and blocks files that don’t meet the rules. This way, the editor stays lightweight, and validation logic remains in my own hands.
Adding File Validation to Lexxy Editor with Stimulus #ruby #rubydeveloper #rubyonrails #Adding #Validation #Lexxy #Editor #Stimulus #stimulus https://www.rubyonrails.ba/link/adding-file-validation-to-lexxy-editor-with-stimulus