Update: So, the source
def link_to(*args, &block) if block_given? options = args.first || {} html_options = args.second link_to(capture(&block), options, html_options) else name = args[0] options = args[1] || {} html_options = args[2] html_options = convert_options_to_data_attributes(options, html_options) url = url_for(options) href = html_options['href'] tag_options = tag_options(html_options) href_attr = "href=\"#{ERB::Util.html_escape(url)}\"" unless href "<a #{href_attr}#{tag_options}>#{ERB::Util.html_escape(name || url)}</a>".html_safe end end
As we can see, this design behavior is from the source.
You can try one of two solutions, I have not tried them, but they should work
1.) Try placing the call on the gateway inside the call on #raw:
<%= link_to "link", raw(gateway_index_url(developer: @item.developer.api_key, tracker:"email", url:@product.url)) %>
This may solve your specific problem, a second approach, while a slightly brighter force should also work ...
2.) If you want to convert it (all href) back, you can use CGI :: unescape_html:
<%= CGI::unescape_html(link_to "link", gateway_index_url(developer: @item.developer.api_key, tracker:"email", url:@product.url)) %>
Good luck, hope this helps.
Update 2: Fixed call to cgi unescape, used ".". when it should be "::" and the formatting fix. Forgot indent example for # 1