Class: Glib::JsonUi::ActionBuilder::Http::AbstractHttp
- Inherits:
-
Action
- Object
- JsonUiElement
- Action
- Glib::JsonUi::ActionBuilder::Http::AbstractHttp
- Defined in:
- app/helpers/glib/json_ui/action_builder/http.rb
Instance Attribute Summary
Attributes inherited from JsonUiElement
Instance Method Summary collapse
Methods inherited from JsonUiElement
action, any, array, badgeable, bool, color, component_name, date, date_time, enum, float, hash, icon, #initialize, int, length, menu, panels_builder, #props, required, singleton_array, string, text, url, views
Constructor Details
This class inherits a constructor from Glib::JsonUi::JsonUiElement
Instance Method Details
#flatten_nested_params(form_data, key, value) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/helpers/glib/json_ui/action_builder/http.rb', line 16 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 |
#formData(hash) ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/helpers/glib/json_ui/action_builder/http.rb', line 8 def formData(hash) form_data = {} hash.each do |key, value| flatten_nested_params(form_data, key, value) end json.formData form_data end |