Rails query string with a period (or full stop).

左心房为你撑大大i 提交于 2019-11-28 13:47:19
mu is too short

Your problem is that Rails is trying to interpret .villa@gmailcom as a format specification (such as .html or .json). AFAIK, the standard work around (or at least the one I use) is to add this to your route:

:requirements => { :email => /.*/ }

This tricks Rails into not trying to be clever about what :email contains.

I'm not surprised that you couldn't find anything, googling for "@" or "." doesn't do anything useful.

match "confirm/:code/:email" => "confirm#index", :email => /.*/

Also it would be better to set get method here, I think

get "confirm/:code/:email" => "confirm#index", :email => /.*/
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!