Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
salex opened this issue Feb 1, 2020 · 0 comments
Open

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

salex opened this issue Feb 1, 2020 · 0 comments

Comments

@salex
Copy link

salex commented Feb 1, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant