开发者

Escaping dots and backslashes in URL

I develop a small rails app. It has a controller books. Route /books/:title shows a book with specified tit开发者_运维技巧le.

The problem is that if book contains dots . or backslashes /, application returns either error Record not found, or routing error.

How to escape these characters, so that application can show such books correctly?


Well, I have found a solution. I added a route to include query strings for show action:

match '/show', :controller => 'books', :action => 'show'

It fixed my problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜