create and reuse html content
I need to create html content that i need to embed in a开发者_Python百科 url and send to an api (Dreamhost mailing api).
https://api.dreamhost.com/?cmd=announcement_list-post_announcement&message="here commes html content"
the html is the content of a mail (html formatted)
I wonder how I do this best. Can I use a layout and grab the content of the layout?
Thanks
You can render a partial and save the result as a string
html = render_to_string :partial => 'mails/template'
精彩评论