Sha256: 23cb3a1f7f8ceb990b1224fa29a3e5f886c7e06db44d3c3f0d0881adef277e1e

Contents?: true

Size: 794 Bytes

Versions: 9

Compression:

Stored size: 794 Bytes

Contents

# coding: utf-8
module QiniuDirectUploader
  module FormHelper
    def qiniu_uploader_form(options = {}, &block)
      uploader = Uploader.new(options)
      form_tag(uploader.action, uploader.form_options) do
        all_hidden_fields = {}
        all_hidden_fields =  all_hidden_fields.merge uploader.fields

        custom_hidden_fields = {}
        uploader.custom_fields.each do |key,value|
          custom_hidden_fields["x:#{key}"] = value
        end

        all_hidden_fields =  all_hidden_fields.reverse_merge custom_hidden_fields
        #all_hidden_fields = all_hidden_fields.reverse_merge({:ooo=>uploader.return_body})

        all_hidden_fields.map do |name, value|
          hidden_field_tag(name, value)
        end.join.html_safe + capture(&block)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
qiniu_direct_uploader-0.0.9 lib/qiniu_direct_uploader/form_helper.rb
qiniu_direct_uploader-0.0.8 lib/qiniu_direct_uploader/form_helper.rb
qiniu_direct_uploader-0.0.7 lib/qiniu_direct_uploader/form_helper.rb
qiniu_direct_uploader-0.0.6 lib/qiniu_direct_uploader/form_helper.rb
qiniu_direct_uploader-0.0.5 lib/qiniu_direct_uploader/form_helper.rb
qiniu_direct_uploader-0.0.4 lib/qiniu_direct_uploader/form_helper.rb
qiniu_direct_uploader-0.0.3 lib/qiniu_direct_uploader/form_helper.rb
qiniu_direct_uploader-0.0.2 lib/qiniu_direct_uploader/form_helper.rb
qiniu_direct_uploader-0.0.1 lib/qiniu_direct_uploader/form_helper.rb