【发布时间】:2012-01-21 12:46:31
【问题描述】:
我看了很多,只是找不到语法错误,我不断收到:
compile error
/home/durrantm/code/it_trunk/webapp/app/views/campaign_groups/_cgs_overview.html.erb:36: syntax error, unexpected kELSE, expecting ')'
; else ; @output_buffer.concat "\n ...
^
/home/durrantm/code/it_trunk/webapp/app/views/campaign_groups/_cgs_overview.html.erb:40: syntax error, unexpected kEND, expecting ')'
; end ; @output_buffer.concat "\n\n"
^
/home/durrantm/code/it_trunk/webapp/app/views/campaign_groups/_cgs_overview.html.erb:43: syntax error, unexpected kENSURE, expecting ')'
/home/durrantm/code/it_trunk/webapp/app/views/campaign_groups/_cgs_overview.html.erb:45: syntax error, unexpected kEND, expecting ')'
页面(_cgs_overview.html.erb)的整个代码是:
<% if @campaign_group.campaigns.count > 0 %>
<%=# render :partial => 'show_offer_images' %>
<div class="overview">
<table class="show_activity show_overview">
<tr>
<th>Unique Shoppers</th>
<td id="overview-shoppers" class="clearable">-</td>
</tr>
<tr>
<th>Issuances</th>
<td id="overview-issuances" class="clearable">-</td>
</tr>
<tr>
<th>Redemptions</th>
<td title="Redemption rate does not include informational campaigns" id="overview-redemptions" class="clearable">-</td>
</tr>
<tr>
<th>Total Cost</th>
<td id="overview-cost" class="clearable">-</td>
</tr>
<tr>
<th>Products</th>
<td id="overview-products" class="clearable">-</td>
</tr>
</table>
</div>
<div style="clear:both;"></div>
<div style="width:300px; padding-bottom: 10px">
<%=# link_to("<<", campaign_group_path(params[:id], :offer_images_offset_for_pagination => @previous_images_to_paginate )) %>
<%=# link_to(">>", campaign_group_path(params[:id], :offer_images_offset_for_pagination => @next_images_to_paginate )) %>
<%=# link_to(">ajax>", :remote => true, :action => 'show_offer_images', :campaign_group_id => params[:id], :offer_images_offset_for_pagination => @next_images_to_paginate ) %>
</div>
<% else %>
<p style="font-size:120%;font-style:italic;margin:140px 0 160px;">
There are no campaigns in this group.
</p>
<% end %>
【问题讨论】:
-
把它分成两半,本地化,就像 git bisect 做的那样
-
您应该做的第一件事是删除所有注释行,例如
<%=# render :partial => .... %>,然后重试 -
谢谢大家,我在发帖前已经尝试过上述方法。还是卡住了。这个真的很奇怪,这就是我发布它的原因
-
我删除了中间的 html 表格并将其替换为 ';table' 但没有运气
标签: ruby-on-rails ruby syntax show erb