开发者

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'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜