1

I am trying to code my portfolio in Ruby on Rails, and there is a problem when I want to set the link to my project.

Problem: I set the link like this <a href="www.example.org"target="_blank">Visit <%= project.title %></a> and instead of displaying it in a new window like www.example.org it is displayed as http://localhost:3000/www.example.org.

Sorry if it is a dumb question but I am a newbie. Lots of thanks for the answers.

1 Answer 1

1

try <a href="http://www.example.org" target="_blank">...</a>

If you don't specify the scheme (e.g. http://) the browser will interpret the link as relative to the current domain.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, it worked :) and huge thanks for the explanation also.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.