Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 生成路径并通过flash消息发送路径_Ruby On Rails - Fatal编程技术网

Ruby on rails 生成路径并通过flash消息发送路径

Ruby on rails 生成路径并通过flash消息发送路径,ruby-on-rails,Ruby On Rails,当rails在searcch中错误输入用户名时,我试图让rails将第一个不匹配的用户名发送到浏览器 flash[:error] = "<a href=#{@possible_matches[0]} Did you mean #{@possible_matches[0].username}?</a>" 我可以让文本显示在屏幕上,但链接显示在对象类/ID上,而不是路径。关于下一步的方向有什么建议吗?目前还不清楚你想要实现什么,你能详细说明一下吗?您发布的锚定标记在语法上不正确

当rails在searcch中错误输入用户名时,我试图让rails将第一个不匹配的用户名发送到浏览器

 flash[:error] = "<a href=#{@possible_matches[0]} Did you mean #{@possible_matches[0].username}?</a>"

我可以让文本显示在屏幕上,但链接显示在对象类/ID上,而不是路径。关于下一步的方向有什么建议吗?

目前还不清楚你想要实现什么,你能详细说明一下吗?您发布的锚定标记在语法上不正确,应该是这样的。如果您将预期输出和实际输出包括在内,那就更好了