Rails encoding url params from a helper method
When I generate a url in a Rails helper it converts the querystring params from this:开发者_Go百科
?id=2&asdfsadf=2234324
into:
?id=2&asdfsadf=2234324
I'm using this url to link to an image. Is this url still valid even though the ampersands have been replaced?
Yes -- it's valid HTML. Your browser will decode the &
into &
. (It's not valid for pasting into the address bar. Well, technically it is valid, but it won't do what you expect.)
精彩评论