Sha256: 6f703090a28b9f082c25aa4948c5bc43a0140d530a6bac185cc6527482445e66

Contents?: true

Size: 852 Bytes

Versions: 10

Compression:

Stored size: 852 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # A helper to expose an easy way to add authorization forms in a view.
  module AuthorizationFormHelper
    # Creates a ew authorization form in a view, accepts the same arguments as
    # `form_for`.
    #
    # record  - The record to use in the form, it should be a descendant of
    # AuthorizationHandler.
    # options - An optional hash with options to pass wo the form builder.
    # block   - A block with the content of the form.
    #
    # Returns a String.
    def authorization_form_for(record, options = {}, &)
      default_options = {
        builder: AuthorizationFormBuilder,
        as: "authorization_handler",
        url: decidim_verifications.authorizations_path
      }

      options = default_options.merge(options)
      decidim_form_for(record, options, &)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-core-0.30.0.rc3 app/helpers/decidim/authorization_form_helper.rb
decidim-core-0.30.0.rc2 app/helpers/decidim/authorization_form_helper.rb
decidim-core-0.30.0.rc1 app/helpers/decidim/authorization_form_helper.rb
decidim-core-0.29.2 app/helpers/decidim/authorization_form_helper.rb
decidim-core-0.29.1 app/helpers/decidim/authorization_form_helper.rb
decidim-core-0.29.0 app/helpers/decidim/authorization_form_helper.rb
decidim-core-0.29.0.rc4 app/helpers/decidim/authorization_form_helper.rb
decidim-core-0.29.0.rc3 app/helpers/decidim/authorization_form_helper.rb
decidim-core-0.29.0.rc2 app/helpers/decidim/authorization_form_helper.rb
decidim-core-0.29.0.rc1 app/helpers/decidim/authorization_form_helper.rb