문제

I want a resource URI to look like this:

https://domain.tld/resource?param=foo&param=bar&param=baz

But Rails requires array query params to use the square bracket notation. Before URL escaping, the Rails equivalent of the above URI looks like this:

https://domain.tld/resource?param[]=foo&param[]=bar&param[]=baz

I can manually wrangle request.url inside of my controller, but I'd rather not do this ad-hoc if I can help it. Is there a standard way to support the first style of URI in Rails?

도움이 되었습니까?

해결책

No standard way.

Any way I think it is not good idea to change it for whole rails application, because it breaks conventions (and probably some helpers).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top