Class: Admin::TicketsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- ApplicationController
- BaseController
- Admin::TicketsController
- Defined in:
- app/controllers/admin/tickets_controller.rb
Constant Summary
Constants inherited from BaseController
BaseController::INTERNAL_SERVER_ERROR_MESSAGE
Instance Method Summary collapse
Methods inherited from BaseController
#destroy_session, #identity_cache_memoization, #sign_in_page, #user_developer_session
Methods included from LogrageCustomLogger
Methods included from AdminHelper
#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?
Methods included from UpdateLocaleConcern
Methods inherited from ApplicationController
#after_sign_in_path_for, #after_sign_out_path_for, #default_url_options, #identity_cache_memoization, #render_not_found, #routing_error, search_params_key=
Methods included from ControllerHelpers
#check_boolean_param, #get_banners, #inventory_params, #reservation_params
Instance Method Details
#edit ⇒ Object
22 |
# File 'app/controllers/admin/tickets_controller.rb', line 22 def edit; end |
#index ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/admin/tickets_controller.rb', line 9 def index title: 'Tickets Overview' @grid = ::Admin::TicketsGrid.new(params[:admin_tickets_grid]) do |scope| if params[:ticket_code].present? scope.where(ticket_transaction_id: @ticket_transaction.id, ticket_code: params[:ticket_code]).page(params[:page]).per(50) else scope.where(ticket_transaction_id: @ticket_transaction.id).page(params[:page]).per(50) end end fresh_when @grid.assets.cache_key end |
#update ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'app/controllers/admin/tickets_controller.rb', line 24 def update if @ticket.update ticket_params redirect_to admin_ticket_transaction_tickets_path(@ticket_transaction), notice: 'Data updated' else flash[:error] = @ticket.errors..to_sentence render 'edit' end end |