Rails link_to - 将字符串添加到<a> tag rather than an attribute

时间:2017-04-10 18:04:01

标签: html ruby-on-rails ruby ruby-on-rails-4 devise

I'm trying to turn off link tracking on Mailchimp as described in this article:

https://mandrill.zendesk.com/hc/en-us/articles/205582927-Can-I-disable-click-tracking-on-selected-links-in-my-email-

基本上,他们需要我添加一个字符串(缺少更好的单词,因为它不是属性)到一个href链接,就像这样

点击此处确认您的电子邮件地址

应用/视图/色器件/邮寄者/ reset_password_instructions.html.erb

 [[100.01095590221843,    [70.027389755546068,    [90.016433853327641,
  95.013694877773034,     68.028485345767905,     80.021911804436854, 
  90.016433853327641,     66.029580935989742,     80.021911804436854,
  85.019172828882233,     64.030676526211579,     70.027389755546068,
  80.021911804436854,     62.03177211643343,      ]]
  75.024650779991447]     60.032867706655267,
                          43.042180223540925,
                          22.05368392087027,
                          19.055327306203068]

html_options和url_options都不适用于此,我在此处的文档中尝试过:https://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to

是否可以通过link_to进行?

1 个答案:

答案 0 :(得分:2)

我无法找到解决此问题的直接方法。所以我不得不摆脱link_to并将我的ruby代码放在href中。这可能看起来像这样

    <a href= "<%= edit_password_url(@resource, :reset_password_token => @token) %>"  mc:disable-tracking> Change my password</a>