-1
我使用的輔助collection_check_boxes:Colllection_check_boxes語法錯誤,意外 '',預計 ')'
<li class="form-fields__group">
<label>Ownership type</label>
<div class="field">
<%= collection_check_boxes (:freelancer, :ownership_type_ids, OwnershipType.all, :id, :title) %>
</div>
</li>
在控制檯錯誤:
SyntaxError (/home/ubuntu/workspace/app/views/freelancers/edit.html.erb:192: syntax error, unexpected ',', expecting ')'
...ction_check_boxes (:freelancer, :ownership_type_ids, Ownersh...
... ^
/home/ubuntu/workspace/app/views/freelancers/edit.html.erb:192: syntax error, unexpected ',', expecting &. or :: or '[' or '.'
...pe_ids, OwnershipType.all, :id, :title));@output_buffer.saf...
... ^
/home/ubuntu/workspace/app/views/freelancers/edit.html.erb:192: syntax error, unexpected ')', expecting keyword_end
...nershipType.all, :id, :title));@output_buffer.safe_append='
... ^):
爲什麼這個錯誤? collection_check_boxes有什麼問題?
刪除空間。 <%= collection_check_boxes(:freelancer,:ownership_type_ids,OwnershipType.all,:id,:title)%> – HashRocket
哇)謝謝! –
我會在下面發表我的回答,並請接受它。謝謝! – HashRocket