Change string replace char

Hi everybody,

I am still trying to change the default Rails char for replacing a
space.
I am putting a string into the URL. The string is like “This is a
sentence”. Rails converts it into “http://…/This+is+a+sentence”.
What I would like to have is just like this here:
“http://…/This-is-a-sentence”.

Does anybody know something about this topic ?

I would be very thankful.

Greets
Alex