Skip to content

Instantly share code, notes, and snippets.

View varyonic's full-sized avatar

Piers Chambers varyonic

View GitHub Profile
@varyonic
varyonic / formtastic_faux_model.rb
Created February 3, 2021 19:37
object that plays well with formtastic
# See https://dondoh-blog.tumblr.com/post/4142258573/formtastic-without-activerecord
# -------------------------------------------------------------------------------
# Faux model object that plays well with formtastic; this is used for example in
# a contact form which generates a request to salesforce
# -------------------------------------------------------------------------------
class FormtasticFauxModel
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming