Redis와 Ohm 및 ActiveRecord없이 양식을 사용하는 방법은 무엇입니까?
-
15-11-2019 - |
문제
Redis를 데이터베이스와 ohm으로 사용하여 ActiveRecord 교체로 사용하고 있습니다.
객체를 만드는 양식을 만들 때 Form_For ViewHelper를 사용하여 객체를 편집하고 생성하기 위해 양식을 만들 수 있습니다.
ohm for work
최고의 안부, 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