質問編集履歴
1
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -15,3 +15,79 @@
|
|
15
15
|
本番用に合わせて、開発でも同じ設定でcsrfエラーが出ないようにするには
|
16
16
|
|
17
17
|
どのようにすればいいのでしょうか?
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
viewのソースと生成されたhtmlになります。
|
22
|
+
|
23
|
+
```
|
24
|
+
|
25
|
+
<%= form_for :article, url: articles_path do |f| %>
|
26
|
+
|
27
|
+
<p>
|
28
|
+
|
29
|
+
<%= f.label :title %><br>
|
30
|
+
|
31
|
+
<%= f.text_field :title %>
|
32
|
+
|
33
|
+
</p>
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
<p>
|
38
|
+
|
39
|
+
<%= f.label :text %><br>
|
40
|
+
|
41
|
+
<%= f.text_area :text %>
|
42
|
+
|
43
|
+
</p>
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
<p>
|
48
|
+
|
49
|
+
<%= f.submit %>
|
50
|
+
|
51
|
+
</p>
|
52
|
+
|
53
|
+
<% end %>
|
54
|
+
|
55
|
+
```
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
```
|
60
|
+
|
61
|
+
<form action="/articles" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="✓" /><input type="hidden" name="authenticity_token" value="/Ni6hYR8Csdbfrl7A9D44wk+tLY7hhnmmWVueW6wjsCSbuYfnrUsqMlgaReNHI5JNqFVA6HJ1fWfhNWO3OsthQ==" />
|
62
|
+
|
63
|
+
<p>
|
64
|
+
|
65
|
+
<label for="article_title">Title</label><br>
|
66
|
+
|
67
|
+
<input type="text" name="article[title]" id="article_title" />
|
68
|
+
|
69
|
+
</p>
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<p>
|
74
|
+
|
75
|
+
<label for="article_text">Text</label><br>
|
76
|
+
|
77
|
+
<textarea name="article[text]" id="article_text">
|
78
|
+
|
79
|
+
</textarea>
|
80
|
+
|
81
|
+
</p>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<p>
|
86
|
+
|
87
|
+
<input type="submit" name="commit" value="Save Article" data-disable-with="Save Article" />
|
88
|
+
|
89
|
+
</p>
|
90
|
+
|
91
|
+
</form>
|
92
|
+
|
93
|
+
```
|