Method: WithForm::ModelForm#click_button

Defined in:
lib/with_form/model_form.rb

#click_button(action = nil, **options) ⇒ Object



89
90
91
92
93
94
95
96
97
98
# File 'lib/with_form/model_form.rb', line 89

def click_button(action = nil, **options)
  if action.present?
  elsif @model.persisted?
    action = :update
  else
    action = :create
  end

  scope_form.click_button action, **options
end