Class: Spree::Transit::StopsController

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

Instance Method Summary collapse

Methods inherited from BaseController

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

Instance Method Details

#collectionObject



6
7
8
9
10
11
12
13
# File 'app/controllers/spree/transit/stops_controller.rb', line 6

def collection
  return @collection if defined?(@collection)

  current_vendor.stops

  @search = current_vendor.stops.includes(:state).ransack(params[:q])
  @collection = @search.result
end

#load_locationObject



15
16
17
# File 'app/controllers/spree/transit/stops_controller.rb', line 15

def load_location
  @locations = Spree::State.all
end

#location_after_saveObject



19
20
21
# File 'app/controllers/spree/transit/stops_controller.rb', line 19

def location_after_save
  transit_stops_url
end

#model_classObject



23
24
25
# File 'app/controllers/spree/transit/stops_controller.rb', line 23

def model_class
  SpreeCmCommissioner::Stop
end

#object_nameObject



27
28
29
# File 'app/controllers/spree/transit/stops_controller.rb', line 27

def object_name
  'spree_cm_commissioner_stop'
end