0
I am searching for a specific data in the database to return its values in a view (Edgetemplate)
But in the view shows how Undefined
My route
Route.get('/atendimentos/:id_atendimento', 'AtendimentoController.show')
Controller Code
async show ({ params, request, response, view }) {
const atendimento = await Atendimento.find(params.id_atendimento)
return view.render('atendimento', {
atendimento: atendimento
})
}
Code of the View
@layout('layout.app')
@section('content')
{{atendimento.nome_cliente}}
@endsection
There’s something I forgot?
in the controller you are passing the variable
atendimento
have triedatendimento.nome_cliente
?– Lennon S. Bueno