Rails path helper query params. to_s end Then just get the url: .