Help on render file method

Dear all,

kindly look at the below code

<%= link_to image_tag(“backup_configure.png”,:title => “view
chat”),{:action => “open_live_file”,:file_path => @file_path},{:target
=> ‘_new’} %>

def open_live_file
#--------------
@backup = ChathistoryBackup.find(:first)

unless @backup.nil? and params[:file_path].nil?

  file_path = params[:file_path]

  if File.exists?("#{file_path}")

    render :file => "#{file_path}", :layout => false

  end

end

end

when clicking on the above link it opens the html file on a browser
window but it has not shown the images in the html file.

In my public folder

public/Server_exe/ChatHistory/2010-01-10/2010-01-10\1~Vs~2\1~Vs~2.html
=> this is my live chat file path

for the above chat file images are in the following path

public/Server_exe/ChatHistory/2010-01-10/1~Vs~2/ScreenCapture/2120100109101048121.jpg
=> this image is shown in the chat file

when rendering this file why the images are not shown even its all in
public folder

i m running in to this issue for a past 2 days.

Kindly provide Ur advices on this issue

2010/1/12 Newb N. [email protected]:

  @backup = ChathistoryBackup.find(:first)

  end

 end

when clicking on the above link it opens the html file on a browser
window but it has not shown the images in the html file.

If you view the source in your browser what is shown for the image?
Assuming it looks ok what happens if you copy the img src string and
enter that directly in the browser.

If the html seems ok try copying the complete source of the page and
pasting it into the html validator at
http://validator.w3.org/#validate_by_input to check the html is valid.

Colin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs