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?


Here is the script:

<%= notice %>

Name <%= @dicom.name %>


<%= image_tag @dicom.photo.url , :id => 'dicom_image' %>

<%= javascript_include_tag "coordinate" %> <%= update_page_tag do |page| page < <%= update_page_tag do |page| page < <%= link_to 'Edit', edit_dicom_path(@dicom) %> <%= link_to 'Back', dicoms_path %>

It worked when I did the following:

<%= image_tag @dicom.photo.url , :id => 'dicom_image' %>

Based on this:



Thanks Marnen for the advice.

Abder-Rahman A. wrote:

It worked when I did the following:

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

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.


Marnen Laibow-Koser
[email protected]

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.

i could suggest some jquery code if you want

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