简体   繁体   English

发布所有变更Rails

[英]Publish all changes Rails

I have a Rails app where an admin is able to create and edit records in the database, so he/she is working on a list of records. 我有一个Rails应用,管理员可以在其中创建和编辑数据库中的记录,因此他/她正在处理记录列表。 While the admin is editing the records, these changes shouldn't be visible on the public site yet, but only after the admin clicks on a 'publish all' button. 当管理员编辑记录时,这些更改在公共站点上尚不可见,而应在管理员单击“全部发布”按钮后显示。 Is it possible to keep the records in memory but not saving them to the database, until the publish button is clicked? 在单击“发布”按钮之前,是否可以将记录保留在内存中而不保存到数据库中? The admin should be able to navigate between index and show pages while he/she is working on the records. 管理员在处理记录时应该能够在索引页面和显示页面之间导航。

Thanks in advance, 提前致谢,

Rens

In order to share an information between users (living in different processes) you need to store it somewhere. 为了在用户之间共享信息(位于不同的进程中),您需要将其存储在某个地方。 The best way is a database. 最好的方法是数据库。

I suggest you to store the information in the database and add a published boolean attribute. 我建议您将信息存储在数据库中并添加已published布尔属性。 Then make sure to select for public view only the published records. 然后,确保仅选择已发布的记录以供公众查看。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM