ruevaughn
ruevaughn

Reputation: 1319

Rails link_to - add string to <a> tag rather than an attribute

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-

Essentially, they need me to add a string (for lack of better word, since it's not an attribute) to the a href link, like so

Click here to confirm your email address

app/views/devise/mailer/reset_password_instructions.html.erb

<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %></p>

Neither html_options nor url_options works for this, which i've tried from the documentation here: https://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to

Is it possible to do via link_to?

Upvotes: 0

Views: 1350

Answers (1)

lunchableavenger
lunchableavenger

Reputation: 44

I wasn't able to find a direct way to fix this. So i had to get rid of the link_to and put my ruby code in the href. Which might look something like this

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

Upvotes: 2

Related Questions