More Options for URL construction ( Retain query parameters and allow Key-Value pairs)#570
More Options for URL construction ( Retain query parameters and allow Key-Value pairs)#570kislayentronic wants to merge 1 commit intoChicagoBoss:masterfrom
Conversation
In one of the requirements I needed all the Query Params for URL construction but this was impossible with current tag. To illustrate it more lets have this forum question https://groups.google.com/forum/#!msg/chicagoboss/IQ0d1DBKgAM/j8Asd8WPjTYJ where Evan Miller suggested/intended doing {% url foo="bar" _req.query_params %} . However this doesn't work as Variables get values like [ {foo, <<"bar">>}, [ {first_param, "x"}, {second_param, "y"} ] ]. This can be resolved if we do a list flatten.
|
We can send nested arrays in query parameters. If you flatten them, you can lost their structure and in most cases, make a huge mess with your data. |
|
As I understand from the code, specifically from this expression:- only key-value pairs or elements of proplists are allowed in My Requirement Please let me know if I am unclear somewhere or if I am missing something. |
In one of the requirements I needed all the Query Params for URL construction but this was impossible with current tag.
To illustrate it more lets have this forum question https://groups.google.com/forum/#!msg/chicagoboss/IQ0d1DBKgAM/j8Asd8WPjTYJ where Evan Miller suggested/intended doing
{% url foo="bar" _req.query_params %}. However this doesn't work as Variables get values likewhich goes unhandled by
lists:map.This can be resolved if we do a
lists:flatten.