Sha256: 8d6cdb8114a452917a488ddfaa0d2501162f42a6f8520f3bcbf91e8e59e48279
Contents?: true
Size: 840 Bytes
Versions: 36
Compression:
Stored size: 840 Bytes
Contents
# frozen_string_literal: true module Decidim # A heper 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 shoulde 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 = {}, &block) default_options = { builder: AuthorizationFormBuilder, as: "authorization_handler", url: authorizations_path } options = default_options.merge(options) decidim_form_for(record, options, &block) end end end
Version data entries
36 entries across 36 versions & 2 rubygems