Ruby has got a built in function (at least with the build we have), e.g.:
YAML.safe_load(File.read(File.join(Rails.root, 'plugins', 'discourse-custom-wizard', 'config', 'national_flags.yml')))
I’ve seen suggestions to use this library, but I need to consume it on the client, not in node:
There seems to be a minified version to use in browsers.
However, what is the recommended “Discourse approach”? I was unable to find an example on the client side.
The reason I ask is that I’m about to PR a third party plugin and I’d rather not have to wire up a new rails method if I don’t need to, but am happy to go that route if it’s the recommended approach. This means it’s a bigger change to his plugin though.