나는 내가 컨트롤러 환자에서이
을 솔루션은 데이터를 환자 컨트롤러
을 보여 발견
def weight
end
그리고 만들어보기 weight.html.slim
p#notice = notice
.row
p
table
thead
tr
th Nome:
th Sexo:
th Data de nascimento:
th Idade:
tbody
tr
td = @patient.name
td = @patient.sex.name
td = @patient.born
td = ((Date.today - @patient.born)/365).to_i
p
table
thead
tr
th Plano:
th Senha de internação:
th Admimissão:
th Altura:
tbody
tr
td = @patient.plan.name
td = @patient.pass
td = @patient.admission
- if @patient.weight.first.inch != nil
td = @patient.weight.first.inch
- else
td = 'Paciente sem altura registrada'
p
table
thead
tr
th Data
th Peso
th IMC:
strong pesos:
tbody
- @patient.weight.each do |m|
tr
- if m.date != nil
td = m.date
- else
td = 'Sem pesos registrados'
- if m.weight != nil
td = m.weight
- else
td = 'sem peso registrado'
- if @patient.weight.first.inch != nil
td = (m.weight/(@patient.weight.first.inch**2).to_f).round(2)
- else
td = 'sem dados para este calculo'
br´
및 in index.html.erb
<td><a href="/peso/<%= patient.id %>" target="_blank">Relatorio</a></td>
routes.rb
get 'peso/:id/', to: 'patients#weight'
에서
그리고는
당신이 다른 침전물 작업을 수행 할 수 있습니까 내 문제 해결? –