User
의 숫자는 Folder
입니다.레일 - 뷰 또는 컨트롤러의 쿼리 모델?
class FoldersController < ApplicationController
def index
@folders = current_user.folders
end
end
#app/views/folders/index.html.haml
- @folders.each
...
하지만 나뿐만 아니라 컨트롤러를 건너 뛸 수 있습니다 : Folder
의 index
조치를 구현하기 위해, 나는 컨트롤러에서 특정 사용자의 폴더를 조회 할 수 있습니다 물론
#app/views/folders/index.html.haml
- current_user.folders.each
...
전자가 훨씬 더 우아 . 그러나 그것들은 실질적으로 다른가? 다른 공연이 있든, 다른 결과가 나왔든 가끔은?