Class: Admin::DeliveryPricingTiersController
Overview
Constant Summary
BaseController::INTERNAL_SERVER_ERROR_MESSAGE
Instance Method Summary
collapse
#destroy_session, #identity_cache_memoization, #sign_in_page, #user_developer_session
#append_info_to_payload
#dynamic_pricings_formatter, #link_to_admin_reservations_path_by_id, #link_to_admin_restaurants_path_by_id, #link_to_log, #optional_locales, #optional_locales_with_labels, #staff_signed_in?
#setup_locale
#after_sign_in_path_for, #after_sign_out_path_for, #default_url_options, #identity_cache_memoization, #render_not_found, #routing_error, search_params_key=
#check_boolean_param, #get_banners, #inventory_params, #reservation_params
Instance Method Details
#create ⇒ Object
15
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/admin/delivery_pricing_tiers_controller.rb', line 15
def create
@delivery_pricing_tier = DeliveryPricingTier.new delivery_pricing_tier_params
if @delivery_pricing_tier.save
redirect_to admin_delivery_pricing_tiers_path
else
flash[:error] = @delivery_pricing_tier.errors.full_messages.to_sentence
render 'new'
end
end
|
#destroy ⇒ Object
41
42
43
44
45
46
47
|
# File 'app/controllers/admin/delivery_pricing_tiers_controller.rb', line 41
def destroy
if @delivery_pricing_tier.destroy
redirect_to admin_delivery_pricing_tiers_path, notice: "successfully deleted"
else
redirect_back fallback_location: back_fallback_location, alert: @delivery_pricing_tier.errors.full_messages.to_sentence
end
end
|
#edit ⇒ Object
29
30
|
# File 'app/controllers/admin/delivery_pricing_tiers_controller.rb', line 29
def edit
end
|
#index ⇒ Object
4
5
6
7
8
9
|
# File 'app/controllers/admin/delivery_pricing_tiers_controller.rb', line 4
def index
set_meta_tags title: 'Delivery Pricing Tier'
@grid = Admin::DeliveryPricingTiersGrid.new(params[:admin_delivery_pricing_tiers_grid]) do |scope|
scope.page(params[:page]).per(10)
end
end
|
#new ⇒ Object
11
12
13
|
# File 'app/controllers/admin/delivery_pricing_tiers_controller.rb', line 11
def new
@delivery_pricing_tier = DeliveryPricingTier.new
end
|
#show ⇒ Object
26
27
|
# File 'app/controllers/admin/delivery_pricing_tiers_controller.rb', line 26
def show
end
|
#update ⇒ Object
32
33
34
35
36
37
38
39
|
# File 'app/controllers/admin/delivery_pricing_tiers_controller.rb', line 32
def update
if @delivery_pricing_tier.update delivery_pricing_tier_params
redirect_to admin_delivery_pricing_tiers_path, notice: "Successfully updated"
else
flash[:error] = @delivery_pricing_tier.errors.full_messages.to_sentence
render 'edit'
end
end
|