我正在为我的 rails 应用程序配置公寓 gem,以便为用户提供创建子域的功能。我有一个嵌套表单,在尝试访问“accounts/new”时出现以下错误:
no implicit conversion of Symbol into Integer in view forms
帐户/new.html.erb
<div>
</div>
<h2>Create an Account</h2>
<%= form_for @account do |f| %>
<%= f.fields_for :owner do |o| %>
<%= form_for o, :email do %>
<%= o.text_field :email, class: 'form-control' %>
<% end %>
<%= form_for o, :password do %>
<%= o.password_field :password, class: 'form-control' %>
<% end %>
<%= form_for o, :password_confirmation do %>
<%= o.password_field :password_confirmation, class: 'form-control' %>
<% end %>
<% end %>
<%= form_for f, :subdomain do %>
<div class="input-group">
<%= f.text_field :subdomain, class: 'form-control' %>
<span class="input-group-addon">.scrumteam.com</span>
</div>
<% end %>
<%= f.submit class: 'btn btn-primary' %>
<% end %>
</div>
</div>
account_controller.rb
private
def account_params
params.require(:account).permit(:subdomain, :owner_attributes => [:email, :password, :password_confirmation])
end