Sha256: e58c7c10aa48bdda2855a5370afd6262c48541817e1c60716651b32480de4582

Contents?: true

Size: 660 Bytes

Versions: 5

Compression:

Stored size: 660 Bytes

Contents

# frozen_string_literal: true
module Decidim
  # A heper to expose an easy way to add authorization forms in a view.
  module DecidimFormHelper
    # A custom form for that injects client side validations with Abide.
    #
    # record - The object to build the form for.
    # options - A Hash of options to pass to the form builder.
    # &block - The block to execute as content of the form.
    #
    # Returns a String.
    def decidim_form_for(record, options = {}, &block)
      options[:data] ||= {}
      options[:data].update(abide: true, "live-validate" => true, "validate-on-blur" => true)
      form_for(record, options, &block)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-core-0.1.0 app/helpers/decidim/decidim_form_helper.rb
decidim-core-0.0.8.1 app/helpers/decidim/decidim_form_helper.rb
decidim-core-0.0.7 app/helpers/decidim/decidim_form_helper.rb
decidim-core-0.0.6 app/helpers/decidim/decidim_form_helper.rb
decidim-core-0.0.5 app/helpers/decidim/decidim_form_helper.rb