Class: Admin::BloggerReviewsController
Overview
typed: ignore frozen_string_literal: true
Constant Summary
Admin::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
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/admin/blogger_reviews_controller.rb', line 21
def create
@review = Review.new permitted_params
if @review.save
redirect_to admin_blogger_review_path(@review), notice: 'Review created successfully'
else
flash[:alert] = @review.errors.full_messages.to_sentence
render :new
end
end
|
#destroy ⇒ Object
39
40
41
42
43
44
45
|
# File 'app/controllers/admin/blogger_reviews_controller.rb', line 39
def destroy
if @review.destroy
redirect_to [:admin, :blogger_reviews], notice: 'Review destroyed successfully'
else
redirect_back fallback_location: back_fallback_location, notice: @review.errors.full_messages.to_sentence
end
end
|
#edit ⇒ Object
35
36
37
|
# File 'app/controllers/admin/blogger_reviews_controller.rb', line 35
def edit
render :edit
end
|
#index ⇒ Object
9
10
11
12
13
14
15
|
# File 'app/controllers/admin/blogger_reviews_controller.rb', line 9
def index
@grid = BloggerReviewsGrid.new(params[:blogger_reviews_grid]) do |scope|
scope.page(params[:page])
end
etag = CityHash.hash32([self.class.to_s, @grid.assets.cache_key, I18n.locale])
nil unless stale?(etag: etag)
end
|
#new ⇒ Object
17
18
19
|
# File 'app/controllers/admin/blogger_reviews_controller.rb', line 17
def new
@review = Review.new
end
|
#show ⇒ Object
31
32
33
|
# File 'app/controllers/admin/blogger_reviews_controller.rb', line 31
def show
set_meta_tags title: @review.title
end
|
#update ⇒ Object
47
48
49
50
51
52
53
54
|
# File 'app/controllers/admin/blogger_reviews_controller.rb', line 47
def update
if @review.update permitted_params
redirect_to admin_blogger_review_path(@review), notice: 'Review updated successfully'
else
flash[:alert] = @review.errors.full_messages.to_sentence
render :edit
end
end
|