私はRails 3.2.0とDevise 2.0.0.rc2を使用しています。私の仕様を実行すると、私は通常私のRailsサーバを起動したときに私が見ることができないという非推奨警告が出ます。仕様の実行時にDevise 2.0 'layout_by_resource'の廃止予定に関する警告
$ 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
は次のようになります。私はこれらの警告を見ている理由
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
任意のアイデア?
これは私のために働いた。 – Drew