¿Cómo usar un formulario en Redis y Ohm y sin ActiverCord?
-
15-11-2019 - |
Pregunta
Estoy usando Redis como base de datos y Ohm como reemplazo de ActiveRecord.
Cuando creo un formulario para crear un objeto, puedo usar el FORM_FOR ViewHelper para crear fácilmente formularios para editar y crear objetos.
¿Hay algo así para ohm?
Saludos cordiales, Hijolan
Solución
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.
Otros consejos
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.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow