When I print my report
<td><%= link_to (index + 1).to_s, data_report_path(datum.id), target: "_blank" %></td>
in print view,I want the index displayed ,say "1".but when I do print,it shows "1(/report_data/1/report)"
I'm using ruby on rails.
what I have tried:
1.I have added following code in my app/assets/stylesheets/application.css.scss
@media print {
.noprint {display:none !important;}
a:link:after, a:visited:after {
display: none;
content: "";
}
}
2.add class:'no-print' so the code becomes
link_to (index + 1).to_s, data_report_path(datum.id), class:'no-print',target: "_blank"
but neither works.
Where should I add & what code should I add to hide this link when print?
Just tested it in fiddle
and it shows up as normal text in print view but when you are using bootstrap
or foundation
it shows up as you described. Since you are not using bootstrap so i think some other plugin is applying this print style on anchor
a[href]::after {
content: " (" attr(href) ")"
}
So you need to override this style in your custom css file. You can do it by
@media print {
a[href]:after {
content: none !important;
// use important only if you are not able to override it by normal styling
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With