Expand Ruby Markov chains exercise to utilize Rails for a web application.