teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

改善

2020/07/04 06:46

投稿

atage517
atage517

スコア36

title CHANGED
File without changes
body CHANGED
@@ -23,7 +23,7 @@
23
23
  <input name="title">
24
24
  </div>
25
25
  <div class="form-body">
26
- <textarea name="question"></textarea>
26
+ <textarea name="content"></textarea>
27
27
  <br>
28
28
  <input type="submit" value="投稿">
29
29
  </div>
@@ -45,7 +45,7 @@
45
45
  end
46
46
 
47
47
  def create
48
- @post = Post.new(title: params[:title], question: params[:question])
48
+ @post = Post.new(title: params[:title], content: params[:content])
49
49
  @post.save
50
50
  redirect_to("/posts/index")
51
51
  end

2

修正

2020/07/04 06:45

投稿

atage517
atage517

スコア36

title CHANGED
File without changes
body CHANGED
@@ -45,7 +45,7 @@
45
45
  end
46
46
 
47
47
  def create
48
- @post = Post.new(title: params[:title], question: params[:title])
48
+ @post = Post.new(title: params[:title], question: params[:question])
49
49
  @post.save
50
50
  redirect_to("/posts/index")
51
51
  end

1

改善

2020/07/04 06:43

投稿

atage517
atage517

スコア36

title CHANGED
File without changes
body CHANGED
@@ -45,6 +45,8 @@
45
45
  end
46
46
 
47
47
  def create
48
+ @post = Post.new(title: params[:title], question: params[:title])
49
+ @post.save
48
50
  redirect_to("/posts/index")
49
51
  end
50
52
  end