Ruby on Rails Sunday, July 31, 2011

I already have done that, like this:

def unfinished_items
   self.items.where("status = ?", false)
end

def finished_items
  self.items.where("status = ?", true)
end


So I can use the List.unfinished.... But how do I add it as attributes to the json output?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/-hjwaDpDTiAJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment