Class: Spree::Billing::PlacesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/billing/places_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#current_vendor, #default_url_options, #edit_object_url, #handle_unauthorized_vendor, #page, #per_page, #required_vendor_user!, #set_locale, #switch_vendor, #vendors

Methods included from SpreeCmCommissioner::Billing::RoleAuthorization

#auth_action, #auth_entry, #auth_user, #authorize!, #authorize?, #authorize_admin, #authorize_role!, #redirect_unauthorized_access

Instance Method Details

#collectionObject



6
7
8
9
10
11
12
# File 'app/controllers/spree/billing/places_controller.rb', line 6

def collection
  params[:q] = {} if params[:q].blank?
  places = SpreeCmCommissioner::Place.all

  @search = places.ransack(params[:q])
  @collection = @search.result.page(page).per(per_page)
end

#collection_url(options = {}) ⇒ Object



30
31
32
# File 'app/controllers/spree/billing/places_controller.rb', line 30

def collection_url(options = {})
  billing_places_url(options)
end

#load_placeObject



14
15
16
# File 'app/controllers/spree/billing/places_controller.rb', line 14

def load_place
  @place = @object
end

#location_after_saveObject



18
19
20
# File 'app/controllers/spree/billing/places_controller.rb', line 18

def location_after_save
  billing_places_url
end

#model_classObject



22
23
24
# File 'app/controllers/spree/billing/places_controller.rb', line 22

def model_class
  SpreeCmCommissioner::Place
end

#object_nameObject



26
27
28
# File 'app/controllers/spree/billing/places_controller.rb', line 26

def object_name
  'spree_cm_commissioner_place'
end