How ro display Image

877 views
Skip to first unread message

Ruby

unread,
Mar 1, 2008, 12:56:34 PM3/1/08
to Ruby on Rails: Talk
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

Keeran Hawoldar

unread,
Mar 1, 2008, 1:12:30 PM3/1/08
to rubyonra...@googlegroups.com

If you don't want to worry about handling this stuff try attachment_fu

http://clarkware.com/cgi/blosxom/2007/02/24#FileUploadFu


--
Posted via http://www.ruby-forum.com/.

rolan...@gmail.com

unread,
Mar 1, 2008, 2:25:03 PM3/1/08
to Ruby on Rails: Talk
simply <img src="/pictures/image.jpg">

Colin Law

unread,
Jun 2, 2013, 6:02:30 AM6/2/13
to rubyonra...@googlegroups.com
On 1 June 2013 16:48, bob blanton <bobb....@gmail.com> wrote:
> 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.

Bob, did you realise that you responded to a question that is 5 years old?

Colin

>
> good luck
> --
> 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-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@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.
>
>

Tamara Temple

unread,
Jun 2, 2013, 2:50:49 PM6/2/13
to rubyonra...@googlegroups.com
Colin Law <cla...@googlemail.com> wrote:
> On 1 June 2013 16:48, bob blanton <bobb....@gmail.com> wrote:
[snip]
> Bob, did you realise that you responded to a question that is 5 years old?
>
> Colin
> >
> > On Saturday, March 1, 2008 9:56:34 AM UTC-8, Ruby wrote:

I am *so* glad I'm not the only one this has happened to this
week.... (different list, same issue...)
Reply all
Reply to author
Forward
0 new messages