#分からないこと
「Ruby on Rails5 速習実践ガイド」を参考にして、タスク管理アプリケーションを作ろうとしています。
新規登録画面のビューを実装したいのですが、NameErrorが発生し、解決方法がわかりません。
書いたコードがこちらになります。
class Task < ApplicationRecord end
class TasksController < ApplicationController def index end def show end def new @task = Task.new end def edit end end
h1 タスクの新規登録 .nav.justify-content-end = link_to "一覧", tasks_path, class: "nav-link" = form_with model: @task, local: true do |f| .form-group = f.label :name = f.text_field :name, class: "form-control", id: "task_name" .form-group = f.label :description = f.text_area :description, rows: 5, class: "form-control", id: "task_description" = f.submit nil, class: "btn btn-primary"
= form_with model: @task, local: true do |f|
の|f|のところが定義されていないのかなーと思っているのですが、解決方法がわかりません。
どなたかご教授願います。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/03/12 17:24