首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >语法错误,意外的keyword_else,期望keyword_end

语法错误,意外的keyword_else,期望keyword_end
EN

Stack Overflow用户
提问于 2015-03-06 03:00:31
回答 1查看 1K关注 0票数 0

我用的是“苗条”,我不知道如何解决这个问题。我看到这个错误:

SyntaxError at /user/user语法错误,意外keyword_else,期待keyword_end;否则;^/视图/用户/共享/_user_item.html.slm:18:语法错误,意外keyword_ensure,期望输入结束

这是从这个文件:

代码语言:javascript
复制
li
  .common_box.box3
    .img_box
        = link_to user do
          - if user.avatar.present?
          img alt="" src="#{user.avatar.try(:image_url, :similar)}" style=("width: 194px;height: 139px;")  /
          - else
            img alt="no image" src="" style=("width: 194px;height: 139px;") /
    .img_detail
      small years
      .circle
        span.age_box = user.age 
      h3 #{user.username} #{current_user.location.state}
      h4 #{user.location.city}, #{user.location.state}
      .green_corner
        img alt="" src="/assets/side_curv.png" /
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-03-06 03:06:11

line 6上试试这个(您的图像标记没有缩进)。

代码语言:javascript
复制
li
  .common_box.box3
    .img_box
        = link_to user do
          - if user.avatar.present?
            img alt="" src="#{user.avatar.try(:image_url, :similar)}" style=("width: 194px;height: 139px;")  /
          - else
            img alt="no image" src="" style=("width: 194px;height: 139px;") /
    .img_detail
      small years
      .circle
        span.age_box = user.age 
      h3 #{user.username} #{current_user.location.state}
      h4 #{user.location.city}, #{user.location.state}
      .green_corner
        img alt="" src="/assets/side_curv.png" /
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28891685

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档