I have a few queries for you Rails 3 gurus out there. How can you accomplish the following?
The following pse开发者_StackOverflow中文版udocode is currently invalid. Thanks all.
@items = (@itemsA + @itemsB).order("name ASC")
@item = Item.where("type = ?" and "condition = ?", "book", "new")
@commenteditems = Item.find_all_by_type_and_condition("book", "new").include("notes").select("item[name]", "notes[note]")
@selecteditems = @items.where("select = ?", true)
I believe what you're looking for is scopes.
精彩评论