Please don't send attachments, just describe the problem and post
whatever is necessary to explain what you are doing/seeing.
To save others downloading and opening it up, the OP is seeing a
broken link instead of the image.
Have a look at the html (View, Page Source or similar in browser) and
see the url that is being generated for the image. Does it look
correct? Try just opening that url in the browser.
You cannot show files on the local machine (that is C:) in a web page,
the browser will not allow it. Usually images are put in a folder
under the public folder of your app. For example if you put them in
public/images then the img src should be /images/filename.jpg
And, when I try this path in a browser I get the image displayed.
You cannot show files on the local machine (that is C:) in a web page,
the browser will not allow it. Usually images are put in a folder
under the public folder of your app. For example if you put them in
public/images then the img src should be /images/filename.jpg
Colin
It seems I'm doing something wrong but not aware of it.
In the dicom_info.rb file which is attached, I made a change in the the
loop for retrieving dicom files as follows:
Dir["./public/images/dcm_files/*.dcm"].each do |dcm|
dicom_files << dcm
end
In this case, when I "View source", I get the path as follows:
Have you looked at the docs for image_tag? If you do you will see that
image_tag( "fiename")
provides /images/filename in the img src, so expecting the image to be
in public/images.
Therefore you need @examination.image to contain just
dcm_files/longfilename.jpg or to strip the bit off the front before
you pass it to image_tag, or of course you could just code up the img
tag yourself rather than using image_tag.
I think you need to ask a more specific question. I’d never heard of DICOM before I read this and I’m very new to ROR. But the attachment seemed very helpful to me.