Skip to content

Instantly share code, notes, and snippets.

@ChangJoo-Park
Created January 14, 2013 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChangJoo-Park/4532028 to your computer and use it in GitHub Desktop.
Save ChangJoo-Park/4532028 to your computer and use it in GitHub Desktop.
find를 find_by_all 로 바꾸면 더 간단하다
class TaskController < ApplicationController
def incomplete
@tasks = Task.find(:all, :conditions => ['complete = ?', false])
end
def last_incomplete
@task = Task.find(:first, :conditions => ['complete =?', false], :order => 'created_at DESC')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment