-
Notifications
You must be signed in to change notification settings - Fork 935
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
Refactor embed.js.erb with layers.yml #5571
base: master
Are you sure you want to change the base?
Conversation
app/assets/javascripts/embed.js.erb
Outdated
new L.OSM.Mapnik(mapnikOptions).addTo(map); | ||
} | ||
const layers = <%= | ||
(YAML.load_file(Rails.root.join("config/layers.yml")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe the outer parentheses are needed here? I tried it in the rails console and I got the same JSON without them...
Also can we indent the ruby code by four spaces so it's a bit more readable? or does that trigger some lint issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I tested it directly with puts
, which didn't like the dangling to_json, but this isn't the case here.
Generated by 🚫 Danger |
Ok I don't think I could've failed harder in squashing the previous commits 🫠 |
Like #5550 but with reading the layers.yml file instead of duplicating information