回答編集履歴

1

ああ

2019/12/27 10:45

投稿

KazuSaka
KazuSaka

スコア640

test CHANGED
@@ -6,7 +6,9 @@
6
6
 
7
7
 
8
8
 
9
+ (2)createアクション内でtopアクションを呼ぶ.
10
+
9
- (2)createアクション内でtopアクションを呼ぶ.その時にフォームから受け取った値もtopアクションへ送信.
11
+ その時にフォームから受け取った値もtopアクションへ送信.
10
12
 
11
13
  **redirect_to :action => 'top', :content => params[:content]**
12
14
 
@@ -18,7 +20,9 @@
18
20
 
19
21
 
20
22
 
23
+ (4)topアクションで定義した@contentの値はビューで閲覧できるので、
24
+
21
- (4)topアクションで定義した@contentの値はビューで閲覧できるので、top.html.erbのテキストエリアに表示.@contentは<%= %>で囲む.
25
+ top.html.erbのテキストエリアに表示.@contentは<%= %>で囲む.
22
26
 
23
27
  **<textarea name="content" ><%= @content %></textarea>**
24
28