我正在将客户特定的部分存储在S3上。当我渲染S3对象的值时,它呈现为文本。如何使其呈现在我的主布局中?
我正在将客户特定的部分存储在S3上。当我渲染S3对象的值时,它呈现为文本。如何使其呈现在我的主布局中?
看起来我只需要:
render :text => myTextFromS3, :layout => true
它有效!
更新: 自从2013年,Rails已经更改
有三种不同的方式:
render html: '<strong>HTML String</strong>' # render with `text/html` MIME type
render plain: 'plain text' # render with `text/plain` MIME type
render body: 'raw body' # render raw content, does not set content type, inherits
# default content type, which currently is `text/html`