views:

75

answers:

3

HI,

I have a image here http://power.itp.ac.cn/~jmyang/funny/fun4.jpg and I want to display it in my Rails site. How should i do that?

EDIT: Well, guys , I understand the downvotes now. It is because it is too naive a qeustions:) Sorry, I know almost nothing about HTML tags before asking the question but thanks to Rails, even that I think I could build a web site myself. Rails rocks!

alt text

A: 

Tested and worked.

<img src="http://power.itp.ac.cn/~jmyang/funny/fun4.jpg", width="500" , height="400"> </img>
pierr
What was your previous attempt? :-/
OscarRyz
Images don't have a closing tag like that... `<img />`
SeanJA
A: 

Put the URL into an img tag inside the view for the page that should display the image.

Greg
+1  A: 

You can also use the action view helpers as such:

<%= image_tag 'http://power.itp.ac.cn/~jmyang/funny/fun4.jpg' %>
Kevin Sylvestre
This works, but if there is no dinamic involved, the static version of the tag (like pierr's) shall save you some millisecons on rendering, which of course you only matter if you have millions of visitors and load is an issue.
Fer