class ParamsKeeper::HiddenFields
Public Class Methods
new(controller, url_options)
click to toggle source
# File lib/params_keeper/hidden_fields.rb, line 3 def initialize(controller, url_options) @controller = controller @url_options = url_options end
Public Instance Methods
call()
click to toggle source
# File lib/params_keeper/hidden_fields.rb, line 8 def call return if @controller.class.keep_params_configs.blank? params = ParamsKeeper::Resolver.new(@controller, @url_options).call return if params.blank? CGI.parse(params.to_query).flat_map do |key, values| values.map { |value| @controller.view_context.hidden_field_tag(key, value, id: nil) } end.join.html_safe end