2009-08-20 2 views

답변

0

모델에서 명명 된 범위를 사용해 본 다음 해당 모델에서 개수를 호출 할 수 있습니다 (예 : 다음

named_scope :tagged_with, lambda {|tag| find_options_for_find_tagged_with(tag)} 

: 그 효과에

Questions.tagged_with("example").count 

또는 뭔가. find_options_for_find_tagged_withacts_as_taggable으로 정의됩니다.