Sha256: 8414108a497c2fe48b850f79c188ae5c3bc0e21870cf1b1bd2023b200ac1f192

Contents?: true

Size: 1.1 KB

Versions: 40

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

module ActionMailer
  # = Action Mailer Form Builder
  #
  # Override the default form builder for all views rendered by this
  # mailer and any of its descendants. Accepts a subclass of
  # ActionView::Helpers::FormBuilder.
  #
  # While emails typically will not include forms, this can be used
  # by views that are shared between controllers and mailers.
  #
  # For more information, see +ActionController::FormBuilder+.
  module FormBuilder
    extend ActiveSupport::Concern

    included do
      class_attribute :_default_form_builder, instance_accessor: false
    end

    module ClassMethods
      # Set the form builder to be used as the default for all forms
      # in the views rendered by this mailer and its subclasses.
      #
      # ==== Parameters
      # * <tt>builder</tt> - Default form builder, an instance of ActionView::Helpers::FormBuilder
      def default_form_builder(builder)
        self._default_form_builder = builder
      end
    end

    # Default form builder for the mailer
    def default_form_builder
      self.class._default_form_builder
    end
  end
end

Version data entries

40 entries across 40 versions & 5 rubygems

Version Path
actionmailer-8.0.2 lib/action_mailer/form_builder.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/actionmailer-7.1.3.4/lib/action_mailer/form_builder.rb
actionmailer-8.0.1 lib/action_mailer/form_builder.rb
actionmailer-8.0.0.1 lib/action_mailer/form_builder.rb
actionmailer-7.2.2.1 lib/action_mailer/form_builder.rb
actionmailer-7.1.5.1 lib/action_mailer/form_builder.rb
actionmailer-8.0.0 lib/action_mailer/form_builder.rb
actionmailer-7.2.2 lib/action_mailer/form_builder.rb
actionmailer-7.1.5 lib/action_mailer/form_builder.rb
actionmailer-8.0.0.rc2 lib/action_mailer/form_builder.rb
actionmailer-7.2.1.2 lib/action_mailer/form_builder.rb
actionmailer-7.1.4.2 lib/action_mailer/form_builder.rb
actionmailer-8.0.0.rc1 lib/action_mailer/form_builder.rb
actionmailer-7.2.1.1 lib/action_mailer/form_builder.rb
actionmailer-7.1.4.1 lib/action_mailer/form_builder.rb
actionmailer-8.0.0.beta1 lib/action_mailer/form_builder.rb
omg-actionmailer-8.0.0.alpha9 lib/action_mailer/form_builder.rb
omg-actionmailer-8.0.0.alpha8 lib/action_mailer/form_builder.rb
omg-actionmailer-8.0.0.alpha7 lib/action_mailer/form_builder.rb
omg-actionmailer-8.0.0.alpha4 lib/action_mailer/form_builder.rb