Class: Workarea::Admin::ShippingServicesController
Instance Method Summary
collapse
#current_user, #find_sort, #wrap_in_view_model, wrap_in_view_model
Methods included from Publishing
#allow_publishing!, #allow_publishing?, #set_publishing_options
Methods included from Visiting
#most_visited
Instance Method Details
#create ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
|
# File 'app/controllers/workarea/admin/shipping_services_controller.rb', line 18
def create
build_rules
if @service.save
flash[:success] = t('workarea.admin.shipping_services.flash_messages.created')
redirect_to shipping_services_path
else
render :new
end
end
|
#destroy ⇒ Object
41
42
43
44
45
|
# File 'app/controllers/workarea/admin/shipping_services_controller.rb', line 41
def destroy
@service.destroy
flash[:success] = t('workarea.admin.shipping_services.flash_messages.removed')
redirect_to shipping_services_path
end
|
#edit ⇒ Object
16
|
# File 'app/controllers/workarea/admin/shipping_services_controller.rb', line 16
def edit; end
|
#index ⇒ Object
6
7
8
|
# File 'app/controllers/workarea/admin/shipping_services_controller.rb', line 6
def index
@services = Shipping::Service.all.page(params[:page])
end
|
#new ⇒ Object
14
|
# File 'app/controllers/workarea/admin/shipping_services_controller.rb', line 14
def new; end
|
#show ⇒ Object
10
11
12
|
# File 'app/controllers/workarea/admin/shipping_services_controller.rb', line 10
def show
redirect_to edit_shipping_service_path(@service)
end
|
#update ⇒ Object
30
31
32
33
34
35
36
37
38
39
|
# File 'app/controllers/workarea/admin/shipping_services_controller.rb', line 30
def update
build_rules
if @service.update_attributes(params[:service])
flash[:success] = t('workarea.admin.shipping_services.flash_messages.saved')
redirect_to shipping_services_path
else
render :edit
end
end
|