Thanks that did it. I am caching the image - though since it's a
webcam image that needs refreshed to stay current the cache is short
lived.


def image
@result = Net::HTTP.get_response(URI.parse('http://
link_to_image.jpg') ).body
end

index.html
<img src="webcam/image'>

image.html.erb
@result

On Jun 7, 1:07 am, Frederick Cheung <[email protected]>
wrote:
> On Jun 7, 7:05 am, Kim <[email protected]> wrote:> Really? Do you really 
> think there isn't a reason why I am not just
> > using an image_tag? Really?
>
> Seems like a legitimate question to me.
>
> > The image is protected and I have been given access to pull it from my
> > web server to use in my app.
>
> > Looking for help in answering my original post please. Thanks.
>
> All an image is is a stream of bytes, which you have already got.
> Furthermore the image is fetched by a separate request. If you really
> need to go down this route you should probably craft the <img> tag to
> point at a particular controller/action in your app and from that
> action make your http request and return the bytes you get. You might
> also want to cache the image on your server.
>
> Or perhaps some rewrite rules to proxy those requests to the origin
> server might make more sense
>
> Fred

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to