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

Version Path
rom-rails-0.9.0 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.9.0.beta1 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.8.0 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.7.0 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.6.0 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.6.0.rc1 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.6.0.beta1 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.5.0 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.5.0.rc1 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.5.0.beta1 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.4.0 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.3.3 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.3.2 lib/generators/rom/form/templates/edit_form.rb.erb
rom-rails-0.3.1 lib/generators/rom/form/templates/edit_form.rb.erb