简体   繁体   中英

Syntax error in RAILS - unexpected ','

I'm trying to add the user's initials as an avatar to the navbar through a partial _avatar, but I'm getting a Syntax error for some reason.

/shared/_navbar

<%= show_avatar(@user), class: "img-circle avatar-small" %>

It says: syntax error, unexpected ',', expecting ')' ...er.append=( show_avatar(@user), class: "img-circle avatar-sm... ... ^

users/_avatar

<div class=“avatar-circle”>
    <span class="initials">
        <%= @user.lastname[0..1].upcase %>
    </span>
</div>

Any ideas why? Thanks

SOLVED. I was duplicating the effort. I just left the div class in the partial _avatar. worked!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM