Padrino::Utils

Module: Padrino::Utils

Extended by:
Utils
Included in:
Utils

Instance Method Summary

Instance Method Details

#build_uri_query(object, namespace = nil) ⇒ Object

Builds an URI query from a Hash or any Object.

Examples (~ marks here that output is actually escaped by CGI):

Utils.build_uri_query(:a => 1, :b => 2)           #=> "a=1&b=2"
Utils.build_uri_query(:a => [1, 2])               #=> ~"a[]=1&a[]=2"
Utils.build_uri_query([1, 2], 'namespace')        #=> ~"namespace[]=1&namespace[]=2"
Utils.build_uri_query(:a => { :d => 2 }, :b => 3) #=> ~"a[d]=2&b=3"

© 2010–2016 Padrino
Licensed under the MIT License.
http://www.rubydoc.info/github/padrino/padrino-framework/Padrino/Utils

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部