Iniciante

D

duca86

Boa tarde , Pessoal.
Sou novo no mundo Ruby on Rails e estou com uma dúvida, estou com o seguinte erro.

"undefined method `cliente'

no model está da seguinte forma :

class Qualificacao < ActiveRecord::Base
attr_accessible :cliente_id, :nota,:restaurante_id, :valor_gasto
end

quando tento fazer algo do tipo

<% @qualificacoes.each do |qualificacao| %>
<tr>
<td><%= qualificacao.cliente.nome %></td>
<td><%= qualificacao.restaurante.nome %></td>
<td><%= qualificacao.nota %></td>
<td><%= qualificacao.valor_gasto %></td>
<td><%= link_to 'Show', qualificacao %></td>
<td><%= link_to 'Edit', edit_qualificacao_path(qualificacao) %></td>
</tr>
<% end %>
</table>

dá esse erro, penso que seria como o getter e setter do Java , no caso euteria que colocar o :cliente e :restaurante no model qualificacao?

Abcs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top