Slim未解释表行tr,HTML输出中缺少
我在Rails应用程序中使用Slim,我的表行(tr)不会在循环中被解释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
- 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>"