这有点傻。我将 Rails 用于我的网络应用程序。它使用以下语句从数据库中获取数据
<div class="show-content"> <%= @page.content %> </div>
相同的示例 html 输出。
<div class="show-content">
Migrations are a convenient way for you to alter your database in a structured and organized manner.
Active Record tracks which migrations have already been run so all you have to do is update your source and run rake db:migrate.
Migrations also allow you to describe these transformations using Ruby.
</div>
如您所见,它们由 3 个段落组成。但是当它们被显示时,换行符(空格)被剥离,这不是我想要的。我应该创建一个助手还是有一个内置函数来做到这一点?