我的代码显示“无效的真实性”而不是“缺少模板”。我需要在程序中进行哪些更改才能获得“缺少模板错误”? img1 img2 img3 errorImg
下面是对整个程序的引用: 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>
路由.rb
Rails.application.routes.draw do
resources :users, only: [:new, :create]
end