Reputation: 683
Quick question for the RoR experts out there.
I'm having a problem with getting the image_tag( ) method to properly format my HTML img element.
I'm pretty certain the reason my image will not load is because of the "/images/" directory that is being added to the front of the URL. (SEE BELOW)
I'm calling the image_tag( ) method like this ::
I'm consuming MY method like this ::
This is the HTML tag that's getting generated ::
Anyone know why this /images/ directory is getting placed on the front of my URL?
Thanks!
Upvotes: 0
Views: 198
Reputation: 11
You have a syntax error in your URL.
An example: If in my controller I use the following:
@my_image_url = "https:/localhost/desktop/02.png"
When I look at the generated page I get:
<img src="/images/https:/localhost/desktop/02.png" alt="bob">
If in my controller I use the following:
@my_image_url = "https://localhost/desktop/02.png"
When I look at the generated page I get:
<img src="https://localhost/desktop/02.png" alt="bob">
Upvotes: 1
Reputation: 161
Try changing https:/secure.gravatar.com... to https://secure.gravatar.com...
Notice you have only one '/'
Upvotes: 2