# RE: Showing Images from a file store

**URL:** <https://www.ruby-forum.com/t/re-showing-images-from-a-file-store/93874>\
**Category:** Rails\
**Created:** [April 12, 2006, 9:15pm UTC](https://www.ruby-forum.com/t/re-showing-images-from-a-file-store/93874 "2006-04-12T21:15:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 12, 2006, 9:15pm UTC](https://www.ruby-forum.com/t/re-showing-images-from-a-file-store/93874/1 "2006-04-12T21:15:28Z")

</div>

Hi John,  
Thanks for the quick response.  
I wanted to show the image along with other data from the controller.  
How do I do that. Looks like I am not understanding it.

 \<%= column1 from the model%\> \<%= column1 from the model%\> \<%= column1 from the model%\> \<%= send\_file '\\xx.xx.xxx.xx\xx\xx\xxx\abc.gif"', :type =\> 'image/jpeg', :disposition =\> 'inline'%\>

Would not work. Sorry for my ignorance.

Thanks  
Silvy Mathews

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 12, 2006, 9:39pm UTC](https://www.ruby-forum.com/t/re-showing-images-from-a-file-store/93874/2 "2006-04-12T21:39:59Z")

</div>

On 4/12/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I wanted to show the image along with other data from the controller.  
> How do I do that. Looks like I am not understanding it.  
> …
> 
> \<%= send\_file '\\xx.xx.xxx.xx\xx\xx\xxx\abc.gif"', :type =\> 'image/jpeg', :disposition =\> 'inline'%\>

Silvy,

What you want to do is set up a controller that handles the dispatching  
of  
the images. It is there that you would have the send\_file command.  
Remember that in HTTP you are going to have seperate request for each  
item  
on the page, so map the new controller url using routes and use that url  
in  
your view, for example “/dynamicimages/abc.gif”.

Does that make sense?

Josh

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 13, 2006, 2:18am UTC](https://www.ruby-forum.com/t/re-showing-images-from-a-file-store/93874/3 "2006-04-13T02:18:17Z")

</div>

Yea sorry my response was a little short - that function would go in the  
controller, i.e.

class FileGrabberController \< ApplicationController  
def grab\_file  
send\_file ‘/path’, :type =\> ‘image/jpeg’, [etc]  
end  
end

then either call the controller directly using an image tag or use a  
helper…  
let me know if that helps - I can post a working example when I get home  
tonight [on the laptop at home]…

Quoting removed\_email\_address@domain.invalid:
