Class: Helpdesk::Admin::TicketTypesController
  
  
  
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  #default_url_options, #ensure_user
  
  
    Instance Method Details
    
      
  
  
    #create  ⇒ Object 
  
  
  
  
    | 
19
20
21
22
23
24
25
26 | # File 'app/controllers/helpdesk/admin/ticket_types_controller.rb', line 19
def create
  @ticket_type = Helpdesk::TicketType.new(ticket_type_params)
  if @ticket_type.save
    redirect_to admin_ticket_types_url, notice: 'Ticket type was successfully created.'
  else
    render action: "new"
  end
end | 
 
    
      
  
  
    #destroy  ⇒ Object 
  
  
  
  
    | 
37
38
39
40
41
42
43
44
45 | # File 'app/controllers/helpdesk/admin/ticket_types_controller.rb', line 37
def destroy
  @ticket_type = Helpdesk::TicketType.find(params[:id])
  @ticket_type.destroy
  respond_to do |format|
    format.html { redirect_to admin_ticket_types_url }
    format.json { head :no_content }
  end
end | 
 
    
      
  
  
    #edit  ⇒ Object 
  
  
  
  
    | 
15
16
17 | # File 'app/controllers/helpdesk/admin/ticket_types_controller.rb', line 15
def edit
  @ticket_type = Helpdesk::TicketType.find(params[:id])
end | 
 
    
      
  
  
    #index  ⇒ Object 
  
  
  
  
    | 
3
4
5 | # File 'app/controllers/helpdesk/admin/ticket_types_controller.rb', line 3
def index
  @ticket_types = Helpdesk::TicketType.all
end | 
 
    
      
  
  
    #new  ⇒ Object 
  
  
  
  
    | 
11
12
13 | # File 'app/controllers/helpdesk/admin/ticket_types_controller.rb', line 11
def new
  @ticket_type = Helpdesk::TicketType.new
end | 
 
    
      
  
  
    #show  ⇒ Object 
  
  
  
  
    | 
7
8
9 | # File 'app/controllers/helpdesk/admin/ticket_types_controller.rb', line 7
def show
  @ticket_type = Helpdesk::TicketType.find(params[:id])
end | 
 
    
      
  
  
    #update  ⇒ Object 
  
  
  
  
    | 
28
29
30
31
32
33
34
35 | # File 'app/controllers/helpdesk/admin/ticket_types_controller.rb', line 28
def update
  @ticket_type = Helpdesk::TicketType.find(params[:id])
  if @ticket_type.update_attributes(ticket_type_params)
    redirect_to admin_ticket_types_url, notice: 'Ticket type was successfully updated.'
  else
    render action: "edit"
  end
end |