I need a draggable picture on my Ruby on Rails- Website and everything is working fine, except the picture does not show up.
This is the code for the picture with its properties:
<img id="drag1" src="/images/img_logo.gif" draggable="true" ondragstart="drag(event)" width="336" height="69">
If I write this, the picture does show up:
<%= image_tag("img_logo.gif") %>
My question: What do I need to insert in the upper code, so my picture (img_logo.gif) does show up?
The picture itself is located in: /app/assets/images/img_logo.gif
The file, in which this code is written is a html.erb file.
I haven't installed any gems like paperclip or imagemagick.
Edit: Thanks to Meagar and Vic, this will work:
Either this:
<%= image_tag('img_logo.gif', draggable: "true", id: "drag1") %>
OR this:
<img id="drag1" src="<%= asset_path('img_logo.gif') %>" draggable="true" ondragstart="drag(event)" width="336" height="69">