How to encode spaces in get params

Hi-

Easy question, just don’t know where to look-

How do I encode an :id that has a space in it:

#tag.tag = “Joe B.”

<% = link_to tag.tag, {:action => stories_by_tag, :id => tag.tag} %>

this throws an error b/c there is a space in the id. Is there a
function that automatically encodes this? The h function doesn’t do
it.

Thanks,
Dino

<% = link_to tag.tag, {:action => stories_by_tag, :id => tag.tag} %>

this throws an error b/c there is a space in the id. Is there a
function that automatically encodes this? The h function doesn’t do
it.

Thanks,
Dino

tag.tag.gsub(’ ', ‘%20’) ???

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs