Module: Concerns::Form::AdditionalSubmitButtons

Extended by:
ActiveSupport::Concern
Defined in:
app/forms/concerns/form/additional_submit_buttons.rb

Instance Method Summary collapse

Instance Method Details

#submit_and_continue_with_edit(*args) ⇒ Object



6
7
8
9
10
11
# File 'app/forms/concerns/form/additional_submit_buttons.rb', line 6

def submit_and_continue_with_edit *args
  options = args.extract_options!
  action = object.new_record? ? :create : :update
  options.merge!(name: 'commit_and_continue_with_edit' ,value: I18n.t("helpers.submit.#{action}_and_continue_with_edit", resource_name: object.model_name.human))
  submit(options)
end

#submit_and_continue_with_new(*args) ⇒ Object



13
14
15
16
17
18
# File 'app/forms/concerns/form/additional_submit_buttons.rb', line 13

def submit_and_continue_with_new *args
  options = args.extract_options!
  action = object.new_record? ? :create : :update
  options.merge!(name: 'commit_and_continue_with_new' ,value: I18n.t("helpers.submit.#{action}_and_continue_with_new", resource_name: object.model_name.human))
  submit(options)
end