作成したものを送信し、データベースに保存しようとすると「No route matches [POST] "/posts/new"」のエラーが起きるのですが、なぜでしょうか?
<div class="col-sm-8 col-sm-push-4"> <h2 class="text-center"><strong><em> ああああああ</em></strong></h2> <form id="form1" name="form1" method="post"> <%= form_tag("/posts/create") do %> <form> <div class="form-group"> <label for="Inputname">name</label> <input type="text" class="form-control" id="Inputname" placeholder="名前を入力してください" name="name"> <label for="Inputimage">pic</label> <input type="file" class="form-control" id="Inputimage" name="image"> <label for="Inputtext">comment</label> <textarea type="text" class="form-control" id="Inputcontent" placeholder="内容を入力してください" name="content"></textarea> </div> <button class="btn btn-warning" type="submit" value="投稿"> 作成</button> </form> <% end %> </div>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/09/21 10:58