Tôi đang sử dụng Rails 3.2.0 và Devise 2.0.0.rc2. Khi tôi chạy thông số kỹ thuật của mình, tôi nhận được cảnh báo không dùng nữa mà tôi không thấy khi nào tôi thường khởi động máy chủ Rails của mình.Devise 2.0 'layout_by_resource' cảnh báo ngừng sử dụng khi chạy thông số kỹ thuật
$ rake
.DEPRECATION WARNING: Layout found at "devise" for
DeviseController but parent controller set layout to :layout_by_resource.
Please explicitly set your layout to "devise" or
set it to nil to force a dynamic lookup.
(called from realtime at
/Users/foo/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/benchmark.rb:310)
/app/controllers/application_controller.rb
tôi trông như thế:
class ApplicationController < ActionController::Base
protect_from_forgery
layout :layout_by_resource
protected
def layout_by_resource
if devise_controller?
if resource_name == :agent && action_name == 'new'
nil
elsif resource_name == :admin && action_name == 'new'
nil
else
'devise'
end
else
'application'
end
end
end
Bất cứ ý tưởng tại sao tôi nhìn thấy những cảnh báo này?
Điều này phù hợp với tôi. – Drew