[英]Rails Route - specific URL
I want to implement a tracking pixel for inside an email. 我想为电子邮件内部实现跟踪像素。
The tracking pixel URL should look something like this: 跟踪像素网址应如下所示:
http://example.com/__track.gif?id=XXXXXXX&u=XXXXX
Questions: 问题:
Thoughts? 有什么想法吗?
Put the following in your routes.rb file: 将以下内容放入您的routes.rb文件中:
match "/_track.gif" => "controller_name#action_name"
Replacing controller_name
& action_name
with those appropriate. 用适当的值替换
controller_name
和action_name
。
I recommend you read over the Rails Guide for routing , as match
is noted in the very first section. 我建议您仔细阅读《 Rails布线指南》 ,因为
match
在第一部分match
已提到。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.