所以我用haml
写这个表格 = form_tag assign_photographers_path, class: "col-md-12 assign-photographers-form-#{portfolio.id}" do
= hidden_field_tag :portfolio_id, portfolio.id
= hidden_field_tag :user_id_1, "", class: "user_id_1"
= hidden_field_tag :user_id_2, "", class: "user_id_2"
= label_tag :user, "Begin typing to assign the first photographer:"
%br
.col-md-8.col-md-offset-2
= text_field_tag :user, nil, class: "form-control photographer-search", data_id: portfolio.id
.clearfix
%div{class: "photographer-list#{portfolio.id} col-md-6 col-md-offset-3"}
%h3 Chosen photographers
.clearfix
%br
= submit_tag "Assign Photographers", :class => "btn btn-primary"
在源代码中显示
<form accept-charset="UTF-8" action="/photographers/assign" class="col-md-12 assign-photographers-form-19" method="post"></form>
然后将表格的内容打印在表格下方。我不知道为什么它在表单标签之外打印。代码有什么问题,我该如何解决?