Sha256: 277f131ec89462a43a9f29e4386b2f4ffdcaccb42e33b06d1e55d346c84d5c7b
Contents?: true
Size: 1.03 KB
Versions: 192
Compression:
Stored size: 1.03 KB
Contents
# frozen_string_literal: true module Playbook module PbForm class Form class SimpleFormForm def initialize(form) self.form = form end def to_partial_path "pb_form/form_simple_form" end def merged_form_system_options [ Array(form_system_options)[0], Hash(Array(form_system_options)[1]).merge( data: { "pb-form-validation": validate }.merge((form_system_options&.last || {}).fetch(:data, {})), html: merged_html, builder: form_builder ), ] end private attr_accessor :form delegate_missing_to :form def merged_html html_options = Hash(Array(form_system_options)[1])[:html] || {} html_class = html_options[:class] html_options[:class] = "pb-form #{html_class}".strip html_options end def form_builder FormBuilder::SimpleFormBuilder end end end end end
Version data entries
192 entries across 192 versions & 1 rubygems