Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Slim未解释表行tr,HTML输出中缺少_Html_Ruby On Rails_Slim Lang - Fatal编程技术网

Slim未解释表行tr,HTML输出中缺少

Slim未解释表行tr,HTML输出中缺少,html,ruby-on-rails,slim-lang,Html,Ruby On Rails,Slim Lang,我在Rails应用程序中使用Slim,我的表行(tr)不会在循环中被解释 - if @item.suggestions.size > 0 table - @item.suggestions.each do |suggestion| tr td=raw "<i>Posted by " + Shopper.find(suggestion.shopper_id).name + " at " + suggestion.created_at.to_format

我在Rails应用程序中使用Slim,我的表行(tr)不会在循环中被解释

- if @item.suggestions.size > 0
  table
  - @item.suggestions.each do |suggestion|
    tr
      td=raw "<i>Posted by " + Shopper.find(suggestion.shopper_id).name + " at " + suggestion.created_at.to_formatted_s(:short) + ":</i>"
    tr
      td= suggestion.comment

我将代码更改为使用与Slim示例代码()相同的约定,从而解决了问题

- if @item.suggestions.any?
  table#suggestions
    - for suggestion in @item.suggestions
      tr
        td= suggestion.comment
      tr
        td=raw "<i>Posted by " + Shopper.find(suggestion.shopper_id).name + " at " + suggestion.created_at.to_formatted_s(:short) + ":</i>"
-if@item.suggestions.any?
表#建议
-有关@item.suggestions中的建议
tr
td=建议。评论
tr
td=raw“postedby”+Shopper.find(suggestion.Shopper\u id).name+“at”+suggestion.created\u at.to\u formatted\u s(:short)+“:”
- if @item.suggestions.any?
  table#suggestions
    - for suggestion in @item.suggestions
      tr
        td= suggestion.comment
      tr
        td=raw "<i>Posted by " + Shopper.find(suggestion.shopper_id).name + " at " + suggestion.created_at.to_formatted_s(:short) + ":</i>"