{"comment":{"url":"https://api.github.com/repos/olenderhub/project1/comments/11323350","html_url":"https://github.com/olenderhub/project1/commit/a8771e6a33ca3e0161b8d44729bc3eb6b6758432#commitcomment-11323350","id":11323350,"user":{"login":"wilgoszpl","id":4175660,"avatar_url":"https://avatars.githubusercontent.com/u/4175660?v=3","gravatar_id":"","url":"https://api.github.com/users/wilgoszpl","html_url":"https://github.com/wilgoszpl","followers_url":"https://api.github.com/users/wilgoszpl/followers","following_url":"https://api.github.com/users/wilgoszpl/following{/other_user}","gists_url":"https://api.github.com/users/wilgoszpl/gists{/gist_id}","starred_url":"https://api.github.com/users/wilgoszpl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilgoszpl/subscriptions","organizations_url":"https://api.github.com/users/wilgoszpl/orgs","repos_url":"https://api.github.com/users/wilgoszpl/repos","events_url":"https://api.github.com/users/wilgoszpl/events{/privacy}","received_events_url":"https://api.github.com/users/wilgoszpl/received_events","type":"User","site_admin":false},"position":5,"line":19,"path":"app/views/articles/index.html.erb","commit_id":"a8771e6a33ca3e0161b8d44729bc3eb6b6758432","created_at":"2015-05-22T08:55:36Z","updated_at":"2015-05-22T08:55:36Z","body":"I think this one should go to decorator/helper. Keep views as simple as possible. I.e:\r\n\r\n    app/helpers/articles_helper.rb\r\n    \r\n    def author(article)\r\n        article.user.email.to_s.split(\"@\")[0].titleize\r\n    end\r\n\r\n    app/views/articles/index.html.erb\r\n\r\n    <%= author article.user %>\r\n\r\nOtherwise, you can specify `to_s` method in your user model and use just `article.user` then, without any helper method."}}