I would suggest (but don't know about your architecture) to do this in to_html. It's bad practice to have initializers doing a lot of work.