Class: Spree::Transit::BranchesController
- Inherits:
-
BaseController
- Object
- Admin::ResourceController
- BaseController
- Spree::Transit::BranchesController
show all
- Defined in:
- app/controllers/spree/transit/branches_controller.rb
Instance Method Summary
collapse
#collection_url, #current_vendor, #edit_object_url, #page, #per_page, #required_vendor_user!, #vendors
Instance Method Details
#branch_params ⇒ Object
30
31
32
|
# File 'app/controllers/spree/transit/branches_controller.rb', line 30
def branch_params
params.require(:branch).permit(:name, :lat, :lon)
end
|
#collection ⇒ Object
9
10
11
12
13
14
15
16
|
# File 'app/controllers/spree/transit/branches_controller.rb', line 9
def collection
return @collection if defined?(@collection)
current_vendor.branches
@search = current_vendor.branches.includes(:state).ransack(params[:q])
@collection = @search.result
end
|
#location_after_save ⇒ Object
18
19
20
|
# File 'app/controllers/spree/transit/branches_controller.rb', line 18
def location_after_save
transit_branches_url
end
|
#model_class ⇒ Object
22
23
24
|
# File 'app/controllers/spree/transit/branches_controller.rb', line 22
def model_class
SpreeCmCommissioner::Branch
end
|
#new ⇒ Object
4
5
6
7
|
# File 'app/controllers/spree/transit/branches_controller.rb', line 4
def new
@branch = SpreeCmCommissioner::Branch.new
super
end
|
#object_name ⇒ Object
26
27
28
|
# File 'app/controllers/spree/transit/branches_controller.rb', line 26
def object_name
'spree_cm_commissioner_branch'
end
|