やりたいこと
以下のエラーの解消
can not load translations from /Users/xxxxx/taskleaf/config/locales/ja.yml: #<Psych::SyntaxError: (<unknown>): mapping values are not allowed in this context at line 5 column 41>
困っていること
問題がある箇所としてtasks/new.html.slimとconfig/locales/ja.ymlを確認したが、文法的にどちらにも問題があるように見えず、解決方法がわからないこと
- new.html.slim
slim
1h1 タスクの新規登録 2 3.nav.justify-content-end 4 = link_to '一覧', tasks_path, class: 'nav-link' 5 6= form_with model: @task, local: true do |f| 7 .form-group 8 = f.label :name 9 = f.text_field :name, class: 'form-control', id: 'task_name' 10 .form_group 11 = f.label :description 12 = f.text_area :description, rows: 5, class: 'form-control', id: 'task_description' 13 = f.submit nil, class: 'btn btn-primary' 14
- config/locales/ja.yml
yml
1ja: 2 activerecord: 3 erros: 4 messages: 5 record_invalid: "バリデーションに失敗しました": "%{errors}" 6 restrict_dependent_destroy: 7 has_one: "%{record}が存在しているので削除できません" 8 has_many: "%{record}が存在しているので削除できません" 9 models: 10 task: タスク 11 attributes: 12 task: 13 id: ID 14 name: 名称 15 description: 詳しい説明 16 created_at: 登録日時 17 updated_at: 更新日時
参考にしたサイト
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/06/16 23:53