Class: Tickets::TicketComponent

Inherits:
CommonComponent show all
Defined in:
app/components/tickets/ticket_component.rb

Overview

This class render a component wit a ticket information

Instance Method Summary collapse

Methods inherited from CommonComponent

#icon, #icon_text, #level, #level_item, #pagy, #turbo_yield

Methods included from ApplicationHelper

#fas_icon, #icon, #icon_text, #l_date, #l_long, #l_time, #notifications, #notify, #notify_status, #t_enum

Constructor Details

#initialize(ticket:, editor: false) ⇒ TicketComponent

Returns a new instance of TicketComponent.



6
7
8
9
# File 'app/components/tickets/ticket_component.rb', line 6

def initialize(ticket:, editor: false)
  @ticket = ticket
  @editor = editor
end

Instance Method Details

#destroy_urlObject



11
12
13
14
15
16
17
# File 'app/components/tickets/ticket_component.rb', line 11

def destroy_url
  if @editor
    editor_ticket_path(@ticket)
  else
    ticket_path(@ticket)
  end
end