On 8 September 2010 22:19, Abder-Rahman Ali <[email protected]> wrote:
>...
> 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:
>
> <img alt="05115014-mr-siemens-avanto-syngo-with-palette-icone"
> src="/images/./public/images/dcm_files/05115014-mr-siemens-avanto-syngo-with-palette-icone.jpg"
> />
>
> Provided that I'm using:
>
> <%= image_tag(@examination.image) %>

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.

Colin

-- 
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