RE: Showing Images from a file store


#1

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


#2

On 4/12/06, removed_email_address@domain.invalid 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


#3

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: