Hide an image in show.html.erb

I have the following "show.html.erb" script, and I get as an output TWO images since I use a method to draw an image.

How can I HIDE the RESOURCE image?

Thanks.

Here is the script:

<canvas id="line" height="512" width="512"> </canvas> <p id="notice"><%= notice %></p> <p> <b> Name </b> <%= @dicom.name %> </p> <p> <b> Image </b> </p> <p> <%= image_tag @dicom.photo.url , :id => 'dicom_image' %> </p> <%= javascript_include_tag "coordinate" %> <%= update_page_tag do |page| page << "drawLine();" end %> <%= update_page_tag do |page| page << "drawImage();" end %> <%= link_to 'Edit', edit_dicom_path(@dicom) %> <%= link_to 'Back', dicoms_path %>

It worked when I did the following:

<div id="image_element" style="display: none;"> <p> <%= image_tag @dicom.photo.url , :id => 'dicom_image' %> </p> </div>

Based on this:

Thanks.

Abder-Rahman Ali wrote:

It worked when I did the following:

<div id="image_element" style="display: none;">

...but never do that. Inline style attributes are poor practice. They are hard to maintain, and clutter HTML markup with presentation information.

Instead, define a CSS class with the appropriate attributes.

Better yet, if the element is always going to be hidden, remove it from the HTML altogether.

Best,

Thanks Marnen for the advice.

i could suggest some jquery code if you want

radhames brito wrote:

i could suggest some jquery code if you want

Thanks @radhames. I really don't have knowledge yet in jquery. So, that's fine. Thanks though.