Ruby on Rails
Saturday, June 1, 2013
I've found the only way so far is to use image_tag . From rails tutorial, <%= image_tag("image_name" , :size => "300x210" )%> the images need to be inside the app, i've used the app/assets/images location, there's system and public also available, but then you need to add path info.
good luck
On Saturday, March 1, 2008 9:56:34 AM UTC-8, Ruby wrote:
-- On Saturday, March 1, 2008 9:56:34 AM UTC-8, Ruby wrote:
I am very new to ruby, just 10 days, I have uploade my images to
public/pictures/<user_id>/<image.jpg | .png | .gif>.
Now I want to display this image on show.rhtml.erb, but I could not
found any option to display it on the browser.
I took the whole path and the image name in @global variable and then
show it on the <img src="<%= @global %>" >
imgpath="#{RAILS_ROOT} / PUBLIC/...../image.jpg"
I tried it without Rails root and pulic, but no luck.
Any one can help me to display images.
Thanks In Advance.
Abhijit
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d7179a9c-43b0-4371-925e-013b64f8782f%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment