如何在Redis和Ohm上使用表格而没有Activerecord?
-
15-11-2019 - |
题
我使用redis作为数据库和欧姆作为astiverecord更换。
当我创建用于创建对象的表单时,我可以使用FORM_FOR ViewHelper来易于创建表单以编辑和创建对象。
在欧姆有类似的东西?
最好的问候,hijolan
解决方案
class MyShinyModel < Ohm::Model
include ActiveModel::SomeModule
# ...
end
And proceed like desribed here http://yehudakatz.com/2010/01/10/activemodel-make-any-ruby-object-feel-like-activerecord/ or here http://asciicasts.com/episodes/219-active-model.
其他提示
There should be no correlation between the ORM you are using and the ActionView form helpers. As long as OHM is an implementation of the ActiveModel API, it should just work as expected.
不隶属于 StackOverflow