Sha256: d32ff9052eff817b378119e465103243bff4e7c50558dba978b7a213d279b813
Contents?: true
Size: 839 Bytes
Versions: 31
Compression:
Stored size: 839 Bytes
Contents
# frozen_string_literal: true module Ariadne module ActionViewExtensions # :nodoc: module FormHelper include ClassNameHelper DEFAULT_FORM_CLASSES = "space-y-8 divide-y divide-gray-200 sm:space-y-5" def ariadne_form_with(model: nil, scope: nil, url: nil, format: nil, classes: {}, attributes: {}, **options, &block) options[:class] = class_names(DEFAULT_FORM_CLASSES, options[:class]) options[:builder] ||= Ariadne::FormBuilder options[:html] ||= {} options = options.merge(attributes) data = { controller: "ariadne-form", } form_with(model: model, scope: scope, url: url, format: format, data: data, **options, &block) end end end end ActiveSupport.on_load(:action_view) do include Ariadne::ActionViewExtensions::FormHelper end
Version data entries
31 entries across 31 versions & 1 rubygems