【发布时间】:2019-06-20 09:11:55
【问题描述】:
我的代码显示“无效的真实性”而不是“缺少模板”。我需要在程序中进行哪些更改才能获得“缺少模板错误”? img1img2img3errorImg
对整个程序的引用如下: link to github resp
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end
new.html.erb 下面:
新视图
<form action="/users" method="post" accept-charset="UTF-8">
<label for="username">Username:</label><br>
<input id="username" name="user[username]" type="text" /><br>
<label for="email">Email:</label><br>
<input id="email" name="user[email]" type="text" /><br>
<label for="password">Password:</label><br>
<input id="password" name="user[password]" type="text" /><br>
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>">
<input type="submit" value="Submit">
</form>
route.rb
Rails.application.routes.draw do
resources :users, only: [:new, :create]
end
【问题讨论】:
-
请将代码添加到您的问题中(而不是图片)
标签: ruby-on-rails ruby ruby-2.6