I have a ruby (1.9.3) on rails (3.1) app where:
app/models/list.rb
class List < ActiveRecord::Base
has_many :tasks
#...
end
app/models/task.rb
class Task < ActiveRecord::Base
belongs_to :list
#...
end
I am trying to loop through a List’s tasks to search if there are ANY tasks that have
task.planned_for.blank? or task.mins.blank?
Essentially if the loop finds either, I need to conditionally display some view code. Thoughts?
the SQL equivalent of ActiveSupport#blank? is:
so in your controller show method:
in your view: