Class: Spree::Transit::Vectors::AmenityValuesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/transit/vectors/amenity_values_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#current_vendor, #edit_object_url, #page, #per_page, #required_vendor_user!, #vendors

Instance Method Details

#collectionObject



14
15
16
17
# File 'app/controllers/spree/transit/vectors/amenity_values_controller.rb', line 14

def collection
  @vector_icons = SpreeCmCommissioner::VectorIcon.all
  @collection ||= Spree::OptionType.where(kind: kind)
end

#collection_url(options = { kind: kind }) ⇒ Object



30
31
32
# File 'app/controllers/spree/transit/vectors/amenity_values_controller.rb', line 30

def collection_url(options = { kind: kind })
  transit_vectors_amenity_values_url(options)
end

#kindObject



34
35
36
# File 'app/controllers/spree/transit/vectors/amenity_values_controller.rb', line 34

def kind
  @kind = 'vehicle_type'
end

#load_objectObject



8
9
10
11
# File 'app/controllers/spree/transit/vectors/amenity_values_controller.rb', line 8

def load_object
  option_value_id = params['option-value-id']
  @object = Spree::OptionValue.find(option_value_id)
end

#model_classObject



20
21
22
# File 'app/controllers/spree/transit/vectors/amenity_values_controller.rb', line 20

def model_class
  Spree::OptionValue
end

#object_nameObject



25
26
27
# File 'app/controllers/spree/transit/vectors/amenity_values_controller.rb', line 25

def object_name
  'option_value'
end