Sha256: 3d250e8e4f42e316caecc04011857170f62e5a0e99bfe40bb1559159edcf7552

Contents?: true

Size: 805 Bytes

Versions: 38

Compression:

Stored size: 805 Bytes

Contents

module Concerns
  module Form
    module AdditionalSubmitButtons
      extend ActiveSupport::Concern

      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

      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
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
itsf_backend-5.0.0.pre app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-4.2.3 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-4.2.2 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-4.2.1 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-4.2.0 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-4.0.1 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-4.0.0 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-3.1.1 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-3.1.0 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-3.0.7 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-3.0.6 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-3.0.5 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-3.0.4 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-3.0.3 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-3.0.2 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-3.0.1 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-3.0.0 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-2.2.1 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-2.2.0 app/forms/concerns/form/additional_submit_buttons.rb
itsf_backend-2.1.0 app/forms/concerns/form/additional_submit_buttons.rb