Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View errors when calling methods on deleted user of the post #46

Open
vrtsev opened this issue Jan 7, 2018 · 0 comments
Open

View errors when calling methods on deleted user of the post #46

vrtsev opened this issue Jan 7, 2018 · 0 comments
Assignees

Comments

@vrtsev
Copy link
Owner

vrtsev commented Jan 7, 2018

Case:

  1. Login

Bug: News feed page throws error 'Undefined method for nil class'
File location: 'app/views/news_feed/_posts.html.erb'
Code fragments:
image_tag(post.user.photo_url, class: 'img-circle w-32 m-r pull-left') if post.user
link_to post.title, (post.user ? user_post_path(post.user.id, post) : '#' )
post.user ? post.user.name : 'Удален'

Expected: There is a 'placeholder user' with name 'Deleted' which will be displayed insted real deleted user. You should implement decorators or use 'gem Cells' which will give you ability to setup logic for view templates of application

@vrtsev vrtsev self-assigned this Jan 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant