<%= form_for(@user) do |f| %> <%= f.label :name%> <%= f.text_field :name %> <%= f.label :password%> <%= f.password_field :password%> <%= f.submit "submit" %> <% end %>
报错提示:undefined method `model_name' for NilClass:Class
@user 是不是没有在 controller 里声明?