Sha256: 67c2faad9821077ece94a09ec8ca5e9e1933f24c56475c599ea620737e676812
Contents?: true
Size: 395 Bytes
Versions: 14
Compression:
Stored size: 395 Bytes
Contents
class Edit<%= model_name %>Form < <%= model_name %>Form commands <%= relation %>: :update input do # define form input attributes # attribute :name, String timestamps :updated_at end validations do # Add form validations # validates :name, presence: true end def commit! <%= relation %>.try { <%= relation %>.update.by_id(id).set(attributes) } end end
Version data entries
14 entries across 14 versions & 1 rubygems