Skip to content

Template doesn't support symbols #113

abotalov opened this Issue Apr 2, 2013 · 2 comments

3 participants

abotalov commented Apr 2, 2013
andrey@andrey-K55VM:~$ irb
1.9.3p392 :004 > require 'addressable/template'
 => true 
1.9.3p392 :005 >"/search{?query*}").expand(query: {color: 'red', text: 'blue'})
NoMethodError: undefined method `unpack' for :color:Symbol

But this works:"/search{?query*}").expand(query: {'color' => 'red', 'text' => 'blue'})

Is this behavior intentional? I think it will be useful to support symbols.

Found here - natritmeyer/site_prism#27


Started looking into this, it appears to come from a dependency on 'idn-ruby' (or 'idn' on Ruby 1.8). Making that gem available fixes the issue for me.

I believe this is a bug because the readme states that dependency as optional. Writing up a fix for it.


Well, it's possible that the best thing to do here is to convert Symbol objects to a String before performing Unicode normalization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.