Sha256: 649c1d90a966da08c7ed0c51946004d5890bbd1e4103d62f10232b34fc0489d8

Contents?: true

Size: 556 Bytes

Versions: 3

Compression:

Stored size: 556 Bytes

Contents

module Plutonium
  module Helpers
    module FormHelper
      include ActionView::Helpers::FormHelper

      def resource_form_for(record, options = {}, &block)
        turbo_frame = options.key?(:turbo_frame) ? options[:turbo_frame] : "_top"
        options = {
          html: {
            data: {
              turbo_frame:
            }
          }
        }.deep_merge! options

        # record = adapt_route_args(record) unless record.is_a?(Array) || options.key?(:url)

        simple_form_for(record, options, &block)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
plutonium-0.6.2 lib/plutonium/helpers/form_helper.rb
plutonium-0.6.1 lib/plutonium/helpers/form_helper.rb
plutonium-0.6.0 lib/plutonium/helpers/form_helper.rb