Module: Crm::StorageLocationsHelper
- Defined in:
- app/helpers/crm/storage_locations_helper.rb
Overview
View helper: storage locations.
Instance Method Summary collapse
- #storage_location_breadcrumb(storage_location = @storage_location) ⇒ Object
- #storage_location_reference(storage_location = @storage_location) ⇒ Object
Instance Method Details
#storage_location_breadcrumb(storage_location = @storage_location) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/helpers/crm/storage_locations_helper.rb', line 4 def (storage_location = @storage_location) bc_array = [] concatenated_filter = {} %i[zone aisle section level bin].each do |filter| location_val = storage_location.send(filter) location_val_formatted = storage_location.send(:"formatted_#{filter}") concatenated_filter["#{filter}_eq"] = location_val bc_array << tag.li(class: 'breadcrumb-item') do link_to "#{filter.to_s.humanize} #{location_val_formatted}", store_storage_locations_path(storage_location.store, q: concatenated_filter) end end bc_array.join.html_safe end |
#storage_location_reference(storage_location = @storage_location) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/helpers/crm/storage_locations_helper.rb', line 18 def storage_location_reference(storage_location = @storage_location) bc_array = [] concatenated_filter = {} storage_location.index_fields.each do |filter| location_val = storage_location.send(filter) location_val_formatted = storage_location.send(:"formatted_#{filter}") concatenated_filter["#{filter}_eq"] = location_val bc_array << link_to(location_val_formatted, store_storage_locations_path(storage_location.store, q: concatenated_filter), title: filter.to_s.humanize, data: { 'bs-toggle': 'tooltip' }, class: 'btn btn-link') end bc_array.join('.').html_safe end |