How to build a route that has `#`?

How can you build a route with a hashtag ( #) in it? I created a route

get 'authors/#/:id' => 'authors#show

But it creates a route

GET    /authors/%23/:id(.:format)

So he has %23where he should be #.

+4
source share
1 answer

You cannot use #the URL on the server, it calls the fragment identifier and is a local built-in anchor which the browser will never send to the server.

Update

OP added information in the comments of re-client routing.

, , . ( HTML5) hashchange, , , , hashchange jQuery, , , Angular .

, URL-, # , .

OP...

. URL- #, /authors#123, , JS hashchange, , - , GET /authors/123.json, HTML .

+7

Source: https://habr.com/ru/post/1626569/


All Articles