Sha256: 60b4355778575f767b0a1981944eec06675bcafd0bed5fbf9b612c514a0608df

Contents?: true

Size: 594 Bytes

Versions: 1

Compression:

Stored size: 594 Bytes

Contents

module KolorPicker
  module Helper
    def colorpicker_options(options, html_options)
      html_options.deep_merge({
        :data => {
          :"kolor-picker" => options.to_json
        }
      })
    end

    def colorpicker_tag(name, value = nil, options = {}, html_options = {})
      hidden_field_tag(name, value, colorpicker_options(options, html_options))
    end

    def colorpicker(object_name, method, options = {}, html_options = {})
      ActionView::Helpers::Tags::HiddenField.new(object_name, method, self, colorpicker_options(options, html_options)).render
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kolor-picker-0.1.0 lib/kolor-picker/helper.rb