Class: Glib::JsonUi::ActionBuilder::Http::AbstractHttp
- Inherits:
-
Action
show all
- Defined in:
- app/helpers/glib/json_ui/action_builder/http.rb
Instance Attribute Summary
#json, #page
Instance Method Summary
collapse
#initialize, #props
Instance Method Details
#flatten_nested_params(form_data, key, value) ⇒ Object
15
16
17
18
19
20
21
22
23
|
# File 'app/helpers/glib/json_ui/action_builder/http.rb', line 15
def flatten_nested_params(form_data, key, value)
if value.is_a?(Hash)
value.each do |nested_key, nested_value|
flatten_nested_params(form_data, "#{key}[#{nested_key}]", nested_value)
end
else
form_data[key] = value
end
end
|
7
8
9
10
11
12
13
|
# File 'app/helpers/glib/json_ui/action_builder/http.rb', line 7
def formData(hash)
form_data = {}
hash.each do |key, value|
flatten_nested_params(form_data, key, value)
end
json.formData form_data
end
|