"Missing partial layouts/application" error on render :partial => "index", :layout => "application" - Rails3

瀏覽次數:198 次
跳到第一則未讀訊息

David Kahn

未讀,
2010年10月27日 下午4:10:142010/10/27
收件者:rubyonra...@googlegroups.com
This is the second time I have seen this error, and been googling around and cant find an explanation. This error is happening with Rails 3/1.9.2 and was not with Rails 2.3.8/1.8.7:


Template is missing
Missing partial layouts/application with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "/Users/DK/Documents/ror/projects/creditcompare3/app/views"



This is the controller code below, and yes, I have verified that the layout application.html.erb exists. What I don't understand is why it seems that Rails is demanding that the layout be a partial. I did try changing the application layout to a partial, and then in this case the page loads without the above error. But on normal non-partial renders, then of course I loose the application template. Makes no sense to have both application.html.erb and a partial _application.html.erb but this seems to be the only way I have found to hack around this error. Is there a new syntax I should be using instead?

    respond_to do |format|
      format.html { render :partial => "index", :layout => "application" }
    end


Thanks much,

David


回覆所有人
回覆作者
轉寄
0 則新訊息