Class: ZendeskRails::TicketsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ZendeskRails::TicketsController
- Defined in:
- app/controllers/zendesk_rails/tickets_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/zendesk_rails/tickets_controller.rb', line 32 def create @handler = Ticket.new(ticket_params) if @ticket = @handler.create after_created_ticket @ticket else render 'new' end end |
#index ⇒ Object
17 18 19 20 |
# File 'app/controllers/zendesk_rails/tickets_controller.rb', line 17 def index email = zendesk_user_attribute(:email) @tickets = Ticket.belonging_to(email) end |
#new ⇒ Object
28 29 30 |
# File 'app/controllers/zendesk_rails/tickets_controller.rb', line 28 def new @handler = Ticket.new end |
#show ⇒ Object
22 23 24 25 26 |
# File 'app/controllers/zendesk_rails/tickets_controller.rb', line 22 def show @ticket = Ticket.find_request(params[:id]) @comment = Comment.new(@ticket) @comments = @ticket.comments(zendesk_config.) end |
#update ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'app/controllers/zendesk_rails/tickets_controller.rb', line 42 def update @ticket = Ticket.find_ticket(params[:id]) @comment = Comment.new(@ticket, comment_params) if @comment.save after_updated_ticket @ticket else render 'show' end end |