Search code examples
ruby-on-railsrubyformsredisohm

How to use a form on Redis and Ohm and without ActiveRecord?


I am using redis as database and ohm as ActiveRecord replacement.

When I create a form for creating an object I may use the form_for viewhelper to easyly create forms to edit and create objects.

Is there something like that for ohm?

Best regards, hijolan


Solution

  • 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.