Created
January 14, 2013 18:12
-
-
Save ChangJoo-Park/4532028 to your computer and use it in GitHub Desktop.
find를 find_by_all 로 바꾸면 더 간단하다
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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