回答編集履歴

1

訂正

2019/11/15 09:39

投稿

asm
asm

スコア15147

test CHANGED
@@ -1,4 +1,20 @@
1
- image_tagなどのviewヘルパーはurlを渡されるところにurl以外を渡されると`url_for`を用いてurlへの変換を自動的に行います。
1
+ ~~image_tagなどのviewヘルパーはurlを渡されるところにurl以外を渡されると`url_for`を用いてurlへの変換を自動的に行います。~~
2
+
3
+ [image_tag](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-image_tag)
4
+
5
+ > The source can be a full path, a file, or an Active Storage attachment.
6
+
7
+
8
+
9
+ と、attachmentが渡せるようになっていました。
10
+
11
+
12
+
13
+ [link_to](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to)や[form_with](https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_with)等はurlに文字列以外を渡されると`url_for`に渡してurlを取得します。
14
+
15
+
16
+
17
+ ---
2
18
 
3
19
 
4
20