Skip to content

Instantly share code, notes, and snippets.

@jlebrech
Created February 7, 2014 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlebrech/8862433 to your computer and use it in GitHub Desktop.
Save jlebrech/8862433 to your computer and use it in GitHub Desktop.
require 'ostruct'
class MyForm < OpenStruct
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
validates :name, :presence => true
def initialize(*args)
super
end
def persisted? ; false ; end;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment