Update rel="nofollow" when editing link in ckeditor - hyperlink

I am using ckeditor and I didn't figure out yet how to update the rel="nofollow" attribute depending on if it's an external page or not. I already found a solution on stackoverflow that puts the nofollow attribute on the link. My problem is that when I am editing the for example external link to an internal link, the rel="nofollow" doesn't get updated.
This is the code that I was talking about: https://stackoverflow.com/a/6930940/6362012
Thanks in advance.

Related

Wrong WordPress links redirection

I have a WordPress web site and the site links was working good. For the last two days, suddenly found web site links redirect to the home page not the target link page. I checked the links code it's okay. I inspect links in the browser and I found this code changed for all links like this :
اتصل بنا
This means the right link code in ohref property and the alternative link code in href so all links open the main page for domain in href property.
What is the solution and what caused this problem?
href="" is where the link is directing. ohref="" is a custom attr that can only work with a javascript function. So unless you have an on click listener with javascript it has no function.If there is a javascript function it will overwrite the href="" with a preventdefault()

Internet Explorer 10 only recognizes some links

I have been testing a site and I found a terrible bug in IE10.
Tour Monkey - Official site
App links are not recognized, but social ones are.
I haven't found anything good already, and the deadline is close. Thanks a lot for your help.
After giving a look I realized that I had to add some content in the a tag. In this case, an img tag.
Old HTML (working in all but IE):
<div class="app-link" id="appstore"><a class="app-link" href="https://itunes.apple.com/us/app/tour-monkey/id810107813?mt=8"></a></div>
New HTML
<div class="app-link" id="appstore"><a class="app-link" href="https://itunes.apple.com/us/app/tour-monkey/id810107813?mt=8" target="_self"><img src="img/appstore.png"></a></div>

Turbolinks causes a link with href="#" to trigger page refresh

I have a very simple link on my page. My link. It causes a page refresh. when I remove "turbolinks", it no longer causes a refresh.
I've used links with hash fragments all the time in the past. Unless I've missed something very fundamental for a long time, I don't understand how this can cause a refresh.
It does not have any JS event handlers attached to it.
Any ideas?
It may not matter, but I'm using jQuery, Twitter-Bootstrap, and Ruby on Rails.
Clues so far:
When I remove Turbolinks, the link behaves properly (does not cause page refresh).
Links with "#" as the URL cause a reload on every page of my app.
Links with any "#hasfragmenttext" will cause a single refresh and then the URL of the page is "mypage#hasfragmenttext", any additional clicks do NOT cause page refresh... hmm.
The above solution didn't work for me but this did :
My link
This can be found at https://github.com/turbolinks/turbolinks
update: This solution works for turbolinks 5, for classic turbolinks check the previous answer by #wael34218
Use data-no-turbolink attribute on that link the error should be gone
<a href="#" data-no-turbolink>My link</a>
With Rails 7 / Hotwire, you now need to use:
data-turbo="false"

How to make a DELETE link to a rails resource?

If I want to make a DELETE link in rails, I write the following code (in this example case to delete a user session in Devise):
<%= link_to('Logout', destroy_user_session_path, :method => :delete) %>
That will turn into the following HTML:
<a rel="nofollow" data-method="delete" href="/users/sign_out">Logout</a>
Works great, except I can't simply put that HTML into a static HTML page. It will simply do a GET request. I assume Rails includes some standard Javascript to turn the above link to one that actually does a DELETE request. So what's the proper way to have a link on a static HTML page to a Rails resource that does a DELETE action? Should I find and grab that Javascript Rails includes in all webpages that does this? Is there a better way?
You can't send a DELETE request with an anchor link, unfortunately - a traditional anchor link will only send a GET request. Actually, you can't really send a true DELETE request at all. If you want to make a delete link, without javascript, the solution is fairly easy. Check out 2.4 How do forms with PUT or DELETE methods work? in the official documentation. Basically, you can simply create a form that submits to the url of your resource, with a method of delete. It's pretty simple, and you don't need to rely on javascript to get the job done. Hope this helps, good luck.
Rails uses JavaScript to handle delete links.
It creates a invisible form, and submits it when you click a link that has a data-method attribute of "delete"
Have a look at handleMethod in https://github.com/rails/jquery-ujs/blob/master/src/rails.js
Maybe your delete links in your static pages will just work when you include rails.js (if you are using jQuery).
If not, you can build a form as it is done in handleMethod on your own.
Since some of my colleagues are working on a native app where the user may not have the JavaScript enabled on their browsers, in such cases the delete link won't work and we would get the show page instead of delete....So if you are unsure whether the user may or or may not have the JS enabled on its browser, you can always generate a route with GET or POST method to the delete action of your controller...This approach would work for the static HTML pages also..

nested iFrame facebook app with facebooker on IE

I've tried to create simple facebook app with iFrame,, but I always get nested iFrame on every I click link on my application, I already tried a solution from site http://railsrant.com/2009/10/14/creating-a-facebook-iframe-app-using-ruby-on-rails-facebooker/
it's work on Firefox and Chrome, but doesn't work at IE
Any idea or suggestion for this?
Thanks
I think you should use this line in your head section, this will open the links in parent window instead of iframe in iframe:
<base target="_parent" />
and also make these URL related to canvasURL(facebook app URL). I hope this will solve your problem.
add target="_top" to your <a href="..."> links

Resources