【发布时间】:2016-10-12 08:26:45
【问题描述】:
我遵循设计教程。我编辑了与教程所说的相同的表单,我看到它呈现了两次。
https://www.sitepoint.com/devise-authentication-in-depth/
我无法回复。
<% header "Sign Up" %>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div class="form-group">
<%= f.label :name %>
<%= f.text_field :name, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :email %>
<%= f.email_field :email, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :password %>
<%= f.password_field :password, autocomplete: "off", class: 'form-control' %>
<% if @validatable %>
<span class="help-block"><%= @minimum_password_length %> characters minimum</span>
<% end %>
</div>
<div class="form-group">
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control' %>
</div>
<%= f.submit "Sign up", class: 'btn btn-primary' %>
<% end %>
<%= render "devise/shared/links" %>
这是我的看法。我没有弄乱控制器。
【问题讨论】:
-
最好在不离开SO的情况下在这里调试代码。那么您可以在此处发布与该问题相关的一些代码吗?喜欢特定的控制器和视图。
-
现已编辑。对不起。
-
不用道歉,很多人都会遇到这种情况。
-
我怀疑这个问题与
turbolinks有关,如果你有,请尝试从application.js中删除//= require turbolinks
标签: ruby-on-rails devise