2016-04-22 14 views
-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) %> 

削除スペース:代わりの

+1

削除スペース。 <%= collection_check_boxes(:フリーランサー、:ownership_type_ids、OwnershipType.all、:id、:title)%> – HashRocket

+0

wow)ありがとう! –

+0

以下に私の答えを掲載し、それを受け入れてください。ありがとう! – HashRocket

答えて

1

<%= collection_check_boxes(:freelancer, :ownership_type_ids, OwnershipType.all, :id, :title) %> 
関連する問題