Sha256: c2474cc16fe8200e0fb0e316344fd2e209ef3ed1e361e4abaffcf0bdbb7a1b5b

Contents?: true

Size: 389 Bytes

Versions: 2

Compression:

Stored size: 389 Bytes

Contents

class <%= @p_class_name %>FormSection < Prime::FormSection
  field :title,
    label: { text: 'Title' },
    input: { 
      text: proc { form.model.title }, 
      placeholder: "Enter title here"
    }

  field :submit, type: :submit,
    button: { title: "Save" },
    action: :on_submit

  def on_submit
    model.assign_attributes(field_values)
    model.save
    screen.back
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
motion-prime-0.9.1 generators/templates/scaffold/form.rb
motion-prime-0.9.0 generators/templates/scaffold/form.rb