Class: Account::TicketsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- ApplicationController
- BaseController
- Account::TicketsController
- Defined in:
- app/controllers/account/tickets_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
caches_page_with_cache_marker, #raise_not_found!
Instance Method Details
#create ⇒ Object
30 31 32 33 34 35 |
# File 'app/controllers/account/tickets_controller.rb', line 30 def create @form ||= Account::TicketForm.new(params[:ticket]) @form.submit if @form.valid? respond_with(@form, location: account_tickets_path) end |
#create_note ⇒ Object
37 38 39 40 41 42 |
# File 'app/controllers/account/tickets_controller.rb', line 37 def create_note @form ||= Account::TicketNoteForm.new(params[:note]) @form.submit if @form.valid? respond_with @form end |
#data ⇒ Object
44 45 46 47 |
# File 'app/controllers/account/tickets_controller.rb', line 44 def data @queries = TranslationCms::Api::Customers::SubjectQuery.all! @departments = TranslationCms::Api::Customers::Department.all! end |
#index ⇒ Object
13 14 15 |
# File 'app/controllers/account/tickets_controller.rb', line 13 def index respond_with @tickets end |
#new ⇒ Object
26 27 28 |
# File 'app/controllers/account/tickets_controller.rb', line 26 def new @form ||= Account::TicketForm.new(fileupload_guid: SecureRandom.base64(15).tr('+/=', 'xyz')) end |
#show ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/controllers/account/tickets_controller.rb', line 17 def show @ticket = TranslationCms::Api::Customers::Ticket.find(params[:id]) @ticket = @ticket.first if @ticket.is_a?(Array) group_by_ticket @notes = TranslationCms::Api::Customers::TicketNote.where(ticket_id: @ticket.id).all @form = Account::TicketNoteForm.build(ticket_id: @ticket.id) respond_with @ticket end |