I’d like to be able to have a text file (which is not in the developer’s control of the content) and have my code pick entries from that file and display them in the web app (or do something else with them)
for example, this text file could be a list of people, or famous quotes that keep displaying on the screen, in order or randomize.
my question is what is the easiest way of implementing this?
Should I put it in XML and parse it? put it in YAML? Where do I do the parsing? in the controller or in the initializers?
For non-technical people, nothing beats plain text files. Force some simple structure, e.g
An example on reading plain text files:
Another option would be to use some markdown and use the parsed text to your content, though that introduces new gems to your project, like RedCarpet.