Class: ForemanPatch::TicketFieldsController

Inherits:
LookupKeysController
  • Object
show all
Includes:
Foreman::Controller::AutoCompleteSearch, Parameters::TicketField
Defined in:
app/controllers/foreman_patch/ticket_fields_controller.rb

Instance Method Summary collapse

Methods included from Parameters::TicketField

#ticket_field_params

Instance Method Details

#create ⇒ Object



16
17
18
19
20
21
22
23
# File 'app/controllers/foreman_patch/ticket_fields_controller.rb', line 16

def create
  @ticket_field = TicketField.new(ticket_field_params)
  if @ticket_field.save
    process_success
  else
    process_error
  end
end

#index ⇒ Object



8
9
10
# File 'app/controllers/foreman_patch/ticket_fields_controller.rb', line 8

def index
  @ticket_fields = resource_base_search_and_page
end

#new ⇒ Object



12
13
14
# File 'app/controllers/foreman_patch/ticket_fields_controller.rb', line 12

def new
  @ticket_field = TicketField.new
end

#resource ⇒ Object



29
30
31
# File 'app/controllers/foreman_patch/ticket_fields_controller.rb', line 29

def resource
  @ticket_field
end

#resource_class ⇒ Object



25
26
27
# File 'app/controllers/foreman_patch/ticket_fields_controller.rb', line 25

def resource_class
  ForemanPatch::TicketField
end

#resource_params ⇒ Object



33
34
35
# File 'app/controllers/foreman_patch/ticket_fields_controller.rb', line 33

def resource_params
  ticket_field_params
end