Class: Admin::Restaurants::TcsController
Overview
Manage Terms and Conditions of Restaurant
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
22
23
24
25
26
27
28
29
30
|
# File 'app/controllers/admin/restaurants/tcs_controller.rb', line 22
def create
@record = model.new permitted_params
if @record.save
redirect_to admin_restaurants_tc_path(@record), notice: 'Success'
else
flash.now[:alert] = @record.errors.full_messages.to_sentence
render :new
end
end
|
#destroy ⇒ Object
43
44
45
46
47
48
49
|
# File 'app/controllers/admin/restaurants/tcs_controller.rb', line 43
def destroy
if @record.destroy
redirect_to admin_restaurants_tcs_path, notice: 'Success'
else
flash.now[:alert] = @record.errors.full_messages.to_sentence
end
end
|
#edit ⇒ Object
32
|
# File 'app/controllers/admin/restaurants/tcs_controller.rb', line 32
def edit; end
|
#index ⇒ Object
10
11
12
13
14
|
# File 'app/controllers/admin/restaurants/tcs_controller.rb', line 10
def index
@records = model.all.order('id DESC')
etag = CityHash.hash32([self.class.to_s, @records.cache_key])
return unless stale?(etag: etag)
end
|
#new ⇒ Object
16
17
18
|
# File 'app/controllers/admin/restaurants/tcs_controller.rb', line 16
def new
@record = model.new
end
|
#show ⇒ Object
20
|
# File 'app/controllers/admin/restaurants/tcs_controller.rb', line 20
def show; end
|
#update ⇒ Object
34
35
36
37
38
39
40
41
|
# File 'app/controllers/admin/restaurants/tcs_controller.rb', line 34
def update
if @record.update_attributes permitted_params
redirect_to admin_restaurants_tc_path(@record)
else
flash.now[:alert] = @record.errors.full_messages.to_sentence
render :edit
end
end
|