18F/identity-idp

View on GitHub
lib/extensions/simple_form/components/submit_component.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module SubmitComponent
  def submit(*args, &block)
    options = args.extract_options!
    content = args.first
    content = template.capture { yield(content) } if block
    template.render SubmitButtonComponent.new(**options, &block).with_content(content)
  end
end

SimpleForm::FormBuilder.send :include, SubmitComponent