私はルビーとnanocに不慣れです。時間に基づいて記事を並べ替えようとしています。そのため、ブログでより正確な結果を得ることができます。
これは私が私のsorted_articles_time.rb
ファイルで使用しているものです/helpers/
def sorted_articles_time
articles.sort_by do |a|
attribute_to_time(a[:time])
end.reverse
end
しかし、その後、エラーが発生します
NoMethodError: private method `sorted_articles_time' called for #<Nanoc::Site:0x007fd93b0a3f40>
私は何を間違っているのですか?また、既存のsorted_articlesメソッドを上書きする方法はありますか?
ありがとう
更新:私はすでにそれをrakeファイルで開始しています。ですから、私のrakeファイルはここで問題ないと思います。
time1 = Time.new
@time = time1.inspect