1

I am developing an application using ruby on Rails that is going to be used to train learners in high fidelity simulations in which they need to record notes in an web based electronic record-keeping system.

The idea is to be able to allow users to retrieve a simulated record from the database, interact with it by adding child records that represent procedure notes, messages to other people and the like, and at the end of the session display the changes and additions that were made. After all of that the "template" record will need to be able to be reset to its original state, returning to the state it was in before the user worked with it.

Multiple users will use the same "template" record in different simulation rooms, so changes made by one user should not affect the data available to other users.

I have already developed much of the application using generated scaffolding that I have modified to produce the basic functionality of the record system.

Now I need to figure out the "simulation mode" functionality which allows a user to "tear off" a copy of a record that will be thrown away after changes are made at the end of a session.

Has anyone developed a rails application that has similar requirements to those I listed above?

I am thinking I will need to store copies of the patient and its child objects in session variables. Are there any examples available to that show how to store copies of objects in session variables and modify and add to those objects using forms? Any help and advice would be very appreciated.

4

2 回答 2

0

https://github.com/collectiveidea/audited

非常酷的宝石,您只需将审核状态存储在会话中,然后回滚到该会话。

于 2012-05-28T19:32:26.197 回答
0

我认为您正在寻找的是版本管理。有很多宝石可以做到这一点,我建议看看:

http://railscasts.com/episodes/255-undo-with-paper-trail

...看看这种功能是否可以通过书面记录来解决。如果没有,请结帐:

https://www.ruby-toolbox.com/categories/Active_Record_Versioning

于 2012-05-28T16:47:42.990 回答