The ‘@’ function is used widely on web apps.
Here I use a jquery plugin called atwho. First download jquery.atwho.js, jquery.caret.js, jquery.atwho.css. Then add these files to app/assets.
*= require jquery.atwho to app/assets/stylesheets/application.css.scss.
Then use it to at users when replying a comment. Following happycasts, bind the textarea like this:
One problem I found was this atwho funciont didn’t work until refreshed this page. When I deleted turoblink, it worked fine. So Finally I solved it by using a gem called jquery.turbolinks.
Sometimes we would like to reply to other’s comment. When we click reply button, we want to ‘@’ this comment’s author.
Thanks to Campo app, I added reply function to my own rails app.
Add following parts to comments view.