このような注文オプションを追加すると、エラーが表示されます
undefined method `call' for # どうすれば修正できますか?
コントローラーの私のコードは
@communities = current_user.get_up_voted Community.(order: 'updated_at DESC').page(params[:page]).per(5)
このような注文オプションを追加すると、エラーが表示されます
undefined method `call' for # どうすれば修正できますか?
コントローラーの私のコードは
@communities = current_user.get_up_voted Community.(order: 'updated_at DESC').page(params[:page]).per(5)
おそらく注文の構文が間違っていると思います:
http://guides.rubyonrails.org/active_record_querying.html#ordering
試す:
Community.order("updated_at DESC")