---
title: "to_query"
author: "夜鸣猪"
date: "2012-05-03T00:18:36Z"
tags: []
categories: ["编程语言"]
slug: "to-query"
draft: false
lastmod: "2012-05-03T00:19:51Z"
id: 1508075
url: "https://hlee.iteye.com/blog/1508075"
---

```ruby
params = {
  :a => "http://google.com",
  :b => 123
}
url = "http://example.com?#{params.to_query}"


<%= link_to 'Link', params.merge({:per_page => 20}) %>

```