0
에 대해 searchlogic 및 rails searchlogic의 정의되지 않은 메소드`order '가 문제가 있거나 해결 방법이 있습니까? 여기, 항상이 오류 메시지가 모델, 컨트롤러 및# WillPaginate :: Collection : 0x37530ac>
class Profile < ActiveRecord::Base
cattr_reader :per_page
@@per_page = 10
end
def index
@search = Profile.search(params[:search])
@profiles = @search.paginate(:page => params[:page])
end
<%= will_paginate order @profiles , :by => :created_at, :as => "name" %>
이 도와주세요보기 코드 사전
아, 빠른 답변에 감사드립니다. view에서 searchlogic의 order 메소드를 사용하려고합니다. will_paginate와 함께 어떻게 할 수 있습니까? – tabaluga
@tabaluga 수정 된 답변보기 –
이봐, 알았다! 저를 올바른 방향으로 가리켜 주셔서 감사합니다! <% = will_paginate @profiles %> <% = order @search, : by => : created_at %> Upps는 새로 고침 버튼을 누르지 않았습니다. 고마워요, 고마워요, 고마워요 – tabaluga