paramsをhiddenにする def params2hidden(_params, name, options = {}) hidden_tags = [] case when _params.is_a?(Hash) _params.map do |key, value| hidden_tags += params2hidden(value, "#{name}[#{key}]", options) end when _params.is_a?(Array) _params.map do |value| hidden_tags += params2hidden(value, "#{name}[]", options) end when _params.is_a?(String) || _params.is_a?(Symbol) hidden_tags << hidden_field_tag(name, _params, options) end return hidden_tags end