Class: SolidusAdmin::StockItems::Edit::Component

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/solidus_admin/stock_items/edit/component.rb

Instance Method Summary collapse

Constructor Details

#initialize(stock_item:, page:) ⇒ Component

Returns a new instance of Component.



4
5
6
7
# File 'app/components/solidus_admin/stock_items/edit/component.rb', line 4

def initialize(stock_item:, page:)
  @stock_item = stock_item
  @page = page
end

Instance Method Details

#form_idObject



15
16
17
# File 'app/components/solidus_admin/stock_items/edit/component.rb', line 15

def form_id
  "#{stimulus_id}-#{dom_id(@stock_item)}"
end

#titleObject



9
10
11
12
13
# File 'app/components/solidus_admin/stock_items/edit/component.rb', line 9

def title
  [
    "#{Spree::StockLocation.model_name.human}: #{@stock_item.stock_location.name}",
  ].join(' / ')
end