This may not be a big problem but I find this one as irritating. I wasn't able to figure it out. I have anchors in my site using link_to and even normal tags. Example:
Demo
will show up as Demo(#)
Authenticate would show up as Authenticate (/authenticate)
But if I view the source from the browser, I can't see a problem.
Does anybody know about this problem? I am using Rails 3 and a MAC.
Thank you,
Junrey
I finally found the answer to my problem and it has something to do with the Blueprint CSS Framework that I am using.
I need to remove this content: " (" attr(href) ") "; from print.css which shows something like this:
a:link:after, a:visited:after { content: " (" attr(href) ") "; font-size: 90%; }
Found the solution from Ruby-Forum (http://www.ruby-forum.com/topic/206645#935056).
Related
I can't figure out how to fix a problem with a title translation that contains a single quote. More of that it happens only when calling
= provide(:title, t('.title'))
When referencing the same YAML translation as H2, it is displayed correctly:
.row
h2 = t('.title')
Here is a line of YAML translation line:
home:
faq:
title: FAQ
about:
title: "À propos d\'Entreprise"
The title is displayed as follows
À propos d'Entreprise
Any idea about how to solve that ? Thank you.
OS: OS X
Rails 4.2.5
Ruby 2.3.0
YAML
Found out how to fix that. I think it is due to the way that Slim interprets code snippets
So here is what I had in application.tml.slim:
title =full_title(yield(:title))
The working version is:
title ==full_title(yield(:title))
Hope this helps.
I am using Html2PDf to convert html to pdf.
But I am not able to achieve that it shows local (latvian) language letters. It shows ? instead.
I do understand that I should somehow add appropriate fonts, but I do not know where to get those fonts (which one support latvinan language) and how to add them into html2pdf.
Html2Pdf is based on tcpdf and currently there is font folder.
I think that is seems trivial question, but I was searching via google, but have not found answer that works for me.
require_once('inc/html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P','A4','en');
//$html2pdf->pdf->setDefaultFont('times');
// HEADER
$pdf_output .='<page style="font-size: 11px; >';
$pdf_output .= '<img src="images/raka_pdf_logo.png" alt="logo"/><br><br><br><br>';
...
You may find the right font-family in html2pdf>tcpdf>fonts
I know that question has been asked and answered before, I have the code I think is the right, but I can't figure it out the right syntax, I think is about the quotes and double quotes.
I'm using phonegap version 2.9, in version 2.2 I could open an external link in Safari, but I had to upgrade to 2.9 or apple won't accept my app. and of course the external links will open inside the app without the back button.
This is an app that links to a mysql database with php trough Json.
This is the part I'm having problems:
if (employee.web) {
$('#actionList').append('<li><a href="#" onclick="window.open("http://' + employee.web + '", "_system");"><h3>Website</h3> ' +
'<p>' + employee.web + '</p></a></li>');
}
This worked perfect without the onclick option (but of course in phonegap version 2.9 it opens inside the application and get stuck there).
But now is just not doing anything when I click on it.
I've been many days trying to solve this problem and is the only thing I need to complete my application.
Yeah, your quotes are a bit messed up. Doing this inline can get hairy to say the least. I would separate my HTML from my JS by creating a separate function. Try something like the below:
if (employee.web) {
$('#actionList').append('<li><h3>Website</h3><p>' + employee.web + '</p></li>');
}
function openLink(url){
window.open('http://' + url, '_system');
}
You can see it here.
The site looks fine when I remove Blueprint. I've tried adding Bootstrap and the same issue occurs.
I've been following this (excellent) tutorial.
According to chrome, this is the code causing this:
http://blazing-fog-1717.herokuapp.com/assets/application-fcc74be8bd91511db934f033390efd28.css
a:link::after, a:visited::after {
content: " (" attr(href) ")";
[...]
I have no idea why blueprint might be doing this, but you can just edit blueprint.css and remove the following rule:
content: " (" attr(href) ")";
Setting the media attribute of your links to print (media="print") can fix the problem as well.
If you don't like either of these solution, you should be able to over-write the css by adding the following CSS code AFTER the inclusion blueprint:
a:link:after, a:visited:after {
font-size:90%;
content: none;
}
I'm not sure about that last part, but you could try it out.
I had the same problem, try to add the following line to config/environments/production.rb
config.assets.precompile += [ "blueprint/*.css" ]
This step is described in section 5.4.3 Deploying to production with Blueprint ;)
I am having hands on Rails 3.1 rc1. There is a weird issue keeps bothering me. Whenever I use link_to function, the link href also appearing.
For example:
<%= link_to 'Say Hello' , '/say/hello' %>
produces the below output in the browser
Say Hello (`/say/hello`)
I don't know why the link href also displaying this way.
I tried the below as well:
< a href="/say/hello"> Say Hello < /a>
Still the same output. It seems like the issue is not related to Rails ???
Please help. You advise is valuable.
Are you using blueprint? I was seeing the same issue, and it was due to blueprint's print.css:
a:link:after, a:visited:after {
content: " (" attr(href) ")";
font-size: 90%;
}