UTF-8 URL をキャッチしようとしています。通常、制約を使用するとうまくいきます。URL/international-delight-iced-coffee/
の場合: ルートは機能します:
match ":post_name", :constraints => { :post_name => /.+/}}
ここではすべて順調です。失敗するのは、高度な制約を使用する必要がある場合です。
match ":post_name", :constraints => Post.new
# inside Post.rb
self.matches?(request)
puts ">>>> Arrived at matches!"
Post.find_by_name(request.path_parameters[:post_name])
end
self.matches
呼び出されることはありません。制約をキャッチする方法はありますか?