ruby - getting an undefined method error from "_user.html.erb" in Rails 3 -


if getting error

undefined method impressionist_count' nil:nilclass after trying use line inside _user.html.erb

<%= @user.impressionist_count+@user.microposts.sum(&:impressionist_count) %> 

where need defined? have inside user.rb

def impressionist_count     impressions.size   end 

i tried in various helpers no avail

when "render @users" each user accessible partial local variable "user". partial should like:

<%= user.impressionist_count+user.microposts.sum(&:impressionist_count) %> 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -