Method: WithForm::ModelForm#click_button

Defined in:
lib/with_form/model_form.rb

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



84
85
86
87
88
89
90
91
92
93
# File 'lib/with_form/model_form.rb', line 84

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