I am using the DataTable to show a table to the user with some information, in one of the columns (Status) a select with options is displayed. I want you to select another option from the select, it is automatically saved to the database. I'm not using forms.
.table-wrapper-tabs id="tab-#{realty.id}"
table.general-table id="#{realty.id}-table" cellspacing="0" width="100%"
thead
tr
- if browser.device.mobile?
th
th.col-md-2 Nome
th.col-md-2 Telefone
th.col-md-2 Email
th.col-md-2 Origem
th.col-md-1 Status
th.col-md-1 Data
tbody
- if realty.leads.any?
- realty.leads.each do |lead|
tr
- if browser.device.mobile?
td
i.fa.fa-arrow-circle-down
td #{lead.name}
td #{lead.phone.empty? ? "Não informado" : lead.phone}
td #{lead.email}
td #{lead.origin}
td
select#leads-status
<option value='0' #{lead.status == 'new_lead' ? 'selected':''} > Novo Lead </option>
<option value='1' #{lead.status == 'interest' ? 'selected':''} > Interessado </option>
<option value='2' #{lead.status == 'visit' ? 'selected':''} > Visita Feita </option>
<option value='3' #{lead.status == 'proposal' ? 'selected':''} > Proposta Feita </option>
<option value='4' #{lead.status == 'no_interest' ? 'selected':''} > Sem Interesse </option>
td #{lead.created_at.strftime("%d/%m/%Y")}
I know I'll probably have to use a change in JS