In my Rails app, I have a view that allows user to modify the rendered HTML, such as move the buttons around, changing the colors of a DIV etc. How can I persist those changes such that when the view is rendered next time, those changes are reflected?
My first thought was to store the modified HTML into database as a text column. However I really don’t like this approach since the HTML can be arbitrarily large, not to mention performance will be very bad. I dug around and so far haven’t a clue, which is puzzling to me since I don’t think this is that rare of a scenario: WYSIWYG type editor, website builder application should all need to solve this problem. Which makes me wonder if I’m going down the wrong track.
Any insights are greatly appreciated!
I think I have found a solution, which is: