0
votes

I am using SLIM, and I am not sure how to fix the indention. I see this error:

SyntaxError at /users/user syntax error, unexpected keyword_else, expecting keyword_end ; else; ^ /views/users/shared/_user_item.html.slim:18: syntax error, unexpected keyword_ensure, expecting end-of-input

It's from this file:

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

1 Answers

1
votes

Try this (your image tag wasn't indented) on line 6.

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" /