Skip to content

Rails crashed with a slim markup that had duplicate data- item #164

@salex

Description

@salex

Don't know is it is Rails or Slim, but I made a mistake in changing an element in a slim template.

The element was:

    progress.w3-white[value="0" max="30" id="progressBar" style="width:100%"
      data-target="pickTicket.progressBar" 
      data-action="load->pickTicket#startTimer"]

This is using Stimulus.js and had a problem using getElementById and changed it to a data-target, bat forgot I already had it in the element.

    progress.w3-white[value="0" max="30" data-target="pickTicket.progressBar" style="width:100%"
      data-target="pickTicket.progressBar" 
      data-action="load->pickTicket#startTimer"]

So I had two data-target="pickTicket.progressBar"

Rails balked, not just with an error, but a public 500.error page in development.

Took a little while to find it in that the log did not give much help in finding the problem,

Removing the duplicate made things right. I know this was my mistake, but just thought I'd point it out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions