diff --git a/lib/sinatra/url_for.rb b/lib/sinatra/url_for.rb index 02a84d3..0edac0e 100644 --- a/lib/sinatra/url_for.rb +++ b/lib/sinatra/url_for.rb @@ -38,7 +38,7 @@ def url_for url_fragment, mode=nil, options = nil optstring = nil if options.is_a? Hash - optstring = '?' + options.map { |k,v| "#{k}=#{URI.escape(v, /[^#{URI::PATTERN::UNRESERVED}]/)}" }.join('&') + optstring = '?' + options.map { |k,v| "#{k}=#{URI.escape(v.to_s, /[^#{URI::PATTERN::UNRESERVED}]/)}" }.join('&') end case mode