Sha256: ba51756656a81489cef8e2f6e97b4ab30c8e38e4a52c63e9e62764e30a1b811c
Contents?: true
Size: 633 Bytes
Versions: 14
Compression:
Stored size: 633 Bytes
Contents
class <%= @p_class_name %>FormSection < Prime::FormSection field :title, label: { text: 'Title' }, input: { text: proc { model.title }, placeholder: "Enter title here" } field :delete, type: :submit, button: { title: "Delete", background_color: :red }, action: :on_delete, if: proc { model.persisted? } field :submit, type: :submit, button: { title: "Save" }, action: :on_submit def on_delete model.delete screen.close_screen(to_root: true) end def on_submit model.assign_attributes(field_values) model.save screen.close_screen end end
Version data entries
14 entries across 14 versions & 1 rubygems