fugee_ohu
(fugee ohu)
1
Trying to build a rails 5.2 form using form_with I get this error: ActionView::Template::Error (wrong number of arguments (given 1, expected 0)):
<%= form_with @item, url: new_item_path, method: ‘get’ do |f| %>
<div class="field">
<%= f.select :item, :item_type_id, ItemType.all, :id, :name %>
</div>
<div class="actions">
<%= f.submit "New item" %>
</div>
<% end %>
RobZolkos
(Rob Zolkos)
2
fugee_ohu
(fugee ohu)
4
<%= form_with(model: @item, url: new_item_path(@item), method: “get”) do |f| %>
<div class="field">
<%= f.select :item, :item_type_id, ItemType.all, :id, :name %>
</div>
<div class="actions">
<%= f.submit "New item" %>
</div>
<% end %>
ActionView::Template::Error (wrong number of arguments (given 5, expected 1…4)):
Which item in the code you shared is being given five arguments? Look there. (It's not the form_for.)
Walter