Layouts: application.rhtml v. mycontroller.rhtml

I was trying to be all DRY and standardize my layouts to one file and
made an application.rhtml. There was no application.rhtml at all
before.

So I renamed all my controller layouts to .txt and then tested. I got
empty pages.

I found some issues with Login/UserEngine and application.rhtml, but
nothing that looked like this behavior. Is routing messing me up? It’s
as if application.rhtml is being totally ignored.

Did I miss this in the API docs? Agile Dev v2 hasn’t re-written the
appropriate sections yet, so I don’t have that crutch. Is there a
discussion of the load order of these files somewhere? Or should I be
poking the Engine guys?

thx,
–dwf

can’t you just define your layout in the application controller?

class ApplicationController < ActionController::Base
layout ‘standard’, :except => [ :rss, :atom ]
end

Joshua wrote:

can’t you just define your layout in the application controller?

He could, but from what I gather that’s what he’s trying to avoid.

DWF, what happens if you delete the layout for that controller entirely?
Have you tried building a new sample app without the login generator?

The application.rhtml default works (and has always) worked fine for me,
but I don’t use any generators, and I don’t have any conflicting (e.g.
your .txt layouts) files hanging around.

Try deleting the alternative layouts first, if no go, it could be the
generator.

  • Daniel

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs