I'd do this by having three attributes on my model: original_text markup_language (which is either textile, markdown, or bbcode), and rendered_text When the user hit save, I'd save the text and use the value they provided for markup_language to figure out what renderer to use to store it into rendered_text.
I'd do this by having three attributes on my model: original_text, markup_language (which is either textile, markdown, or bbcode), and rendered_text. When the user hit save, I'd save the text and use the value they provided for markup_language to figure out what renderer to use to store it into rendered_text.
Yes, I'm going to need to re-retrieve the markup_language the user has selected and the original_text. I like the use of rendered_text to cache the text already rendered, I thought of rendering each time on the view. This method is much better.
The problem with your solution is that I'm going to need this approach on a lot of models and fields, and making original_text, markup_language and rendered_text for each field I want to use is not very DRY. How would I approach this on a more DRY way? Maybe inserting a little model (MarkupText model) on every field that needs that?
Is that possible? – Rolpege Jan 6 at 22:49 It's definitely possible - you'd just need to make a foreign key for each of your fields, instead of having them on your model directly. – Luke Jan 6 at 22:55 Thanks then.
I'm going to use that solution :D – Rolpege Jan 6 at 23:04.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.