Skip to content

Commit c5c2d46

Browse files
committed
Update stock items form to use new form builder
1 parent 44d8185 commit c5c2d46

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

admin/app/components/solidus_admin/stock_items/edit/component.html.erb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%= turbo_frame_tag :resource_modal, target: "_top" do %>
22
<%= render component("ui/modal").new(title: t(".title")) do |modal| %>
3-
<%= form_for @stock_item, url: form_url, html: { id: form_id } do |f| %>
3+
<%= solidus_form_for @stock_item, url: form_url, html: { id: form_id } do |f| %>
44
<div
55
class="flex flex-col gap-6 pb-4"
66
data-controller="<%= stimulus_id %>"
@@ -35,8 +35,7 @@
3535
<% end %>
3636
</div>
3737

38-
<%= render component("ui/forms/field").text_field(
39-
f,
38+
<%= f.text_field(
4039
:count_on_hand,
4140
readonly: true,
4241
value: @stock_item.count_on_hand_was || @stock_item.count_on_hand,
@@ -55,12 +54,10 @@
5554
) %>
5655
<% end %>
5756

58-
<%= render component("ui/forms/switch_field").new(
59-
name: "#{f.object_name}[backorderable]",
57+
<%= f.switch_field(
58+
:backorderable,
6059
label: Spree::StockItem.human_attribute_name(:backorderable),
61-
error: f.object.errors[:backorderable],
6260
hint: t(".backorderable_hint_html"),
63-
checked: f.object.backorderable?,
6461
include_hidden: true,
6562
) %>
6663
</div>

0 commit comments

Comments
 (0)