Sha256: 47f218843b99cb316b4bf637c63be9b7db585657c86ed4304599642735e11f82

Contents?: true

Size: 373 Bytes

Versions: 14

Compression:

Stored size: 373 Bytes

Contents

class New<%= model_name %>Form < <%= model_name %>Form
  commands <%= relation %>: :create

  input do
    # define form input attributes
    # attribute :name, String

    timestamps
  end

  validations do
    # Add form validations
    # validates :name, presence: true
  end

  def commit!
    <%= relation %>.try { <%= relation %>.create.call(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/new_form.rb.erb
rom-rails-0.9.0.beta1 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.8.0 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.7.0 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.6.0 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.6.0.rc1 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.6.0.beta1 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.5.0 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.5.0.rc1 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.5.0.beta1 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.4.0 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.3.3 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.3.2 lib/generators/rom/form/templates/new_form.rb.erb
rom-rails-0.3.1 lib/generators/rom/form/templates/new_form.rb.erb