I am trying to create an ajax functionality for a sample app of michael
heart book . I created a feed model controller which is micropost in
hear
book . I am trying to use ajax like post feed method . But I am getting
some error . I am attaching my code below take a look and help me .
NoMethodError (undefined method `any?’ for nil:NilClass):
This means that you’ve got nil where you think you have an object. So,
looking at the file & line reported, you see that in _feed.html.erb @feed_items must be nil.
So, two questions. Are you sure your AJAX post creates @feed_items? And
do you understand what data is available to partials? (Hint, that second
question is important, because partials do not get rendered in the same
environment with the same object available.)