rails使用“True”打印最后一项

时间:2014-08-05 08:40:59

标签: ruby-on-rails ruby-on-rails-3 devise haml

我有以下代码以显示用户的一些记录:

 = @kid.educations.each do |education|
   = education.studies_centre
   %br
   = education.city_and_country
   %br
   %small
     = education.academic_qualification
   %hr
   %br

= @kid.certificates.each do |certificate|
  = certificate.certificate
  %br
  = certificate.city_and_country
  %br
  %small
    = certificate.description
  %hr
  %br

= @kid.works.each do |work|
  = work.company
  %br
  = work.city_and_country
  %br
  %small
    = work.description
  %hr
  %br

但是在每个记录之后,我都会得到单词true,如下图所示:

enter image description here

我该怎么做才能解决这个问题。在此先感谢您的帮助

1 个答案:

答案 0 :(得分:5)

而不是

= @kid.educations.each do |education|

你应该:

- @kid.educations.each do |education|

等。