rails: Change hash to query string