我一直在关注一个允许我创建登录帐户的教程。我很确定我已按照所有步骤操作,但不会显示创建新帐户的表格。
新的.html.erb:
<% form_for @user, :url => account_path do |f| %>
<%= f.error_messages %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= f.submit "Register" %>
<% end %>
_form.html.erb:
<p><%= f.label :login %></p>
<p><%= f.text_field :login %></p>
<p><%= f.label :email %></p>
<p><%= f.text_field :email %></p>
<p><%= f.label :password, f.object.new_record? ? nil : "Change password" %></p>
<p><%= f.password_field :password %></p>
<p><%= f.label :password_confirmation %></p>
<p><%= f.password_field :password_confirmation %></p>
当我去时,调试器会吐出这个/users/new
:
ApplicationController::current_user_session
Rendered users/_form.html.erb (3.0ms)
Rendered users/new.html.erb within layouts/application (9.8ms)
Completed 200 OK in 165ms (Views: 99.7ms | ActiveRecord: 0.0ms)
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2012-08-12 09:06:44 -0500
因此,它告诉我它已成功渲染,但是当我访问该链接时,什么也没显示。有谁知道为什么?