Mount engine use `prepend` method to get high priority in routes.

This commit is contained in:
Jason Lee 2017-03-09 10:17:30 +08:00
parent d1e6a267f0
commit 47c5edf254
1 changed files with 2 additions and 2 deletions

View File

@ -4,8 +4,8 @@ module RuCaptcha
initializer 'rucaptcha.init' do |app| initializer 'rucaptcha.init' do |app|
# https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/action_dispatch/routing/route_set.rb#L268 # https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/action_dispatch/routing/route_set.rb#L268
# `app.routes.append` start from Rails 3.2 - 5.0 # `app.routes.prepend` start from Rails 3.2 - 5.0
app.routes.append do app.routes.prepend do
mount RuCaptcha::Engine => '/rucaptcha' mount RuCaptcha::Engine => '/rucaptcha'
end end