Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. # GET /todos
  2. # GET /todos.json
  3. def index
  4. @todos = current_user.todos.all
  5. if params.has_key?(:done)
  6. @todos = @todos.where(done: !!params[:done]) # !! forces the boolean context
  7. end
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement