Sha256: 0a699292be2fec3821f60f92713377a6a3a55c840756b6dabf3c6a80e1dbed0a

Contents?: true

Size: 1.08 KB

Versions: 50

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true
# Rails Helper methods to take a hash and turn it to form <input type="hidden">
# fields, works with hash nested with other hashes and arrays, standard rails
# serialization style.  Oddly while Hash#to_query will do this for a URL
# query parameters, there seems to be no built in way to do it to create
# hidden form fields instead.
#
# Code taken from http://marklunds.com/articles/one/314
#
# This is used to serialize a complete current query from current params
# to form fields used for sort and change per-page
module Blacklight::HashAsHiddenFieldsHelperBehavior
  extend Deprecation

  ##
  # Writes out zero or more <input type="hidden"> elements, completely
  # representing a hash passed in using Rails-style request parameters
  # for hashes nested with arrays and other hashes.
  #
  # @deprecated
  # @param [Hash] hash
  # @return [String]
  def render_hash_as_hidden_fields(hash)
    render Blacklight::HiddenSearchStateComponent.new(params: hash)
  end
  deprecation_deprecate render_hash_as_hidden_fields: 'Use Blacklight::HiddenSearchStateComponent instead'
end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
blacklight-7.40.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.39.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.38.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.37.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.36.2 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.36.1 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.36.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.35.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.34.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.33.1 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.33.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.32.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.31.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.30.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.29.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.28.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.27.1 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.27.0 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb
blacklight-7.26.1 app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb