当我添加新产品时,我在rails项目中收到这些错误
" show.html.erb:52:语法错误,意外的keyword_ensure,期待')'
show.html.erb:54:语法错误,意外的keyword_end,期待')' "
即使我的show.html.erb只有50行
MY SHOW.HTML.ERB
<body style="background-image:url('/images/Linux Wallpaper.jpg');">
<div class="panel panel-default panel-list" style="width:70%;margin:20px auto;background-color: rgba(255,255,255,0.1);">
<div class="panel-heading" style="background-color:rgba(126, 232, 173, 0.78);">
<h3 class="panel-title" style="font-family:lucida;display:bold;">
<% if @product.user == current_user %>
<p style="float: right;"><%= link_to 'Edit', edit_product_path(@product), :style=>"background-color:rgb(10, 245, 61);padding: 10px 10px 10px 10px;border-radius: 6px; border:1px solid rgba(255,255,255,0.9);" %> </p>
<p style="float: left;"><%= link_to 'Back', products_path, :style=>"background-color:rgb(10, 245, 61);padding: 10px 10px 10px 10px;border-radius: 6px; border:1px solid rgba(255,255,255,0.9);" %><p>
<center>YOUR PRODUCT : <%=@product.title%></center>
</h3>
</div>
<div class="panel-body" style="background-color:rgba(255,255,255,0.1);">
<div class="row">
<div class="col-lg-9 col-md-4" style="padding-left:30px;">
<%= image_tag(@product.img_url.url(:large),:style => "height:400px;width:800px;border-radius: 4px; border:1px solid rgba(255,255,255,0.9);" %>
</div>
<div class="col-lg-2 col-md-2">
<strong style="color:yellow;font-size:2em;font-weight:bolder;">Name:</strong><br>
<div style="color:lightgreen;font-size:2em;">
<%= @product.title%>
</div>
</div>
<div class="col-lg-3 col-md-3">
<strong style="color:yellow;font-size:2em;font-weight:bolder;">File Type:</strong><br>
<div style="color:lightgreen;font-size:2em;">
<%= @product.filetype%>
</div>
</div>
<div style="float:right;padding-right:10%;">
<div class="col-lg-2 col-md-2">
<strong style="color:yellow;font-size:2em;font-weight:bolder;">Price:</strong><br>
<div style="color:lightgreen;font-size:2em;">
$<%= @product.price %>
</div>
</div>
</div>
<div style="float:right;padding-right:10%;">
<div>
<strong style="color:yellow;font-size:2em;font-weight:bolder;">Tags:</strong><br>
<div style="color:lightgreen;font-size:2em;">
$<%= @product.all_tags %>
</div>
</div>
</div>
</div>
</div>
</div>
所以任何人都可以帮助解决我的问题PLZ
答案 0 :(得分:1)
您的image_tag功能永不关闭
<%= image_tag(@product.img_url.url(:large),:style => "height:400px;width:800px;border-radius: 4px; border:1px solid rgba(255,255,255,0.9);" %>