Sha256: 4e15a226d210c969efdc47e637b4f039f3a1fbbe7d724f153ed3bbff98b71ac5
Contents?: true
Size: 953 Bytes
Versions: 13
Compression:
Stored size: 953 Bytes
Contents
module Turbolinks::Form module ViewHelper extend ActiveSupport::Concern def form_for(record_or_name_or_array, *args, &proc) options = args.extract_options! # makes submit a xhr request that accepts html as response if options.keys.include?(:turbolinks_form) && options[:turbolinks_form] options[:remote] = true options[:data] ||= {} options[:data][:turbolinks_form] = true end super(record_or_name_or_array, *(args << options), &proc) end def form_tag(record_or_name_or_array, *args, &proc) options = args.extract_options! # makes submit a xhr request that accepts html as response if options.keys.include?(:turbolinks_form) && options[:turbolinks_form] options[:remote] = true options[:data] ||= {} options[:data][:turbolinks_form] = true end super(record_or_name_or_array, *(args << options), &proc) end end end
Version data entries
13 entries across 13 versions & 1 rubygems