Frage

Ich verwende Redis als Datenbank und Ohm als ActiveCord-Ersatz.

Wenn ich ein Formular zum Erstellen eines Objekts erstellte, kann ich den Format_For-Viewhelper verwenden, um Formulare einfach zu erstellen, um Objekte zu bearbeiten und zu erstellen.

Gibt es so etwas für Ohm?

beste Grüße, Hijolan

War es hilfreich?

Lösung

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.

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top