app/javascript/controllers/trxform_controller.js
// When an attachment file is selected, set the file-name field
When an attachment file is selected, set the file-name field
When an attachment file is selected set the file - name field
attachmentSelected() {
    var filename = this.attachmentTarget.value;
    var lastIndex = filename.lastIndexOf("\\");
    if (lastIndex >= 0) {
      filename = filename.substring(lastIndex + 1);
      filename = filename;
    }
    this.newreceiptTarget.innerHTML = "Adding receipt: ";
    this.filenameTarget.innerHTML = filename;
  }
attachmentSelected ( ) { var filename = this . attachmentTarget . value ; var lastIndex = filename . lastIndexOf ( "\\" ) ; if ( lastIndex >= 0 ) { filename = filename . substring ( lastIndex + 1 ) ; filename = filename ; } this . newreceiptTarget . innerHTML = "Adding receipt: " ; this . filenameTarget . innerHTML = filename ; }
When an attachment file is selected, set the file-name field
When an attachment file is selected set the file - name field