Rails routes with specific character

161 views Asked by At

I have bellow url request type, that contain # character

http://localhost:3000#user-name

I want to match it to HomeController#show_user, how to write the routes?

1

There are 1 answers

2
megas On BEST ANSWER

From Uniform Resource Locators (URL)

The character "#" is unsafe and should always be encoded because it is used in World Wide Web and in other systems to delimit a URL from a fragment/anchor identifier that might follow it.

You can't use # symbol in your url because it's a reserved character.

You might have seen the usage of symbol like this

https://www.google.com/search?q=hello+world#brs

But this symbol used here as fragment delimeter.