I fetched all users from the database based on city name.
Here is my code:
@othertask = User.find(:all, :conditions => { :city => params[:city]})
@othertask.each do |o|
@other_tasks = Micropost.where(:user_id => o.id).all
end
My problem is when loop gets completed, @other_task holds only last record value.
Is it possible to append all ids record in one variable?
you can do it by following way