...">

Rails image_tag does not close image tag

In a rails project, I use image_tag to create html image elements.

<%= image_tag("test.jpg", :alt => "test image") %>

gives rise to

<img src="test.jpg" alt="test image">

This happens throughout my rails project.

Is there any parameter that someone else has set that causes this? How can I make rails always close the image tag?

+3
source share
1 answer

image_tag ActionView:: Helpers:: TagHelper.tag, , , ( XHTML). , - true. .

 tag(:img, { :src => "test.jpg" }, false)

.


:img "img". :img symbol, , . , "img" , tag, .

+6

Source: https://habr.com/ru/post/1733694/


All Articles