我有一些包含静态文本段落的视图。将这些文本直接放在视图上看起来不正确。除了数据库,还有更好的放置静态文本的地方吗?
问问题
541 次
2 回答
2
我强烈反对使用数据库并强烈鼓励I18N - 在这里查看指南。
于 2013-08-15T14:21:54.520 回答
0
if your content is dynamic. Store it into a database
if your content needs to be translated in multiple languages, store as YML
files in locales.
However,
if its just static text.
I would advise you to create rails partial for each of the paragraphs of static text & then render
them into main view. this way you get nice separation between your view code & content without overly complicating things.
于 2013-08-15T14:25:05.560 回答