Where is the controller's default view template?

Hi,

When I moved from Rail 1.2 to 2.0.2, “script/generate controller xxx”
stopped creating a default layout template in app/view/layouts/. But
the code still works and likely gets a default template for the
controller from somewhere.

Can someone say where this template is stored?

When I want to change something in the controller template, I have to
copy a template from one of my older projects where this template was
generated with pre-2.0 Rails. Is there a better way?

Thanks for any info.

=sudhir.

Am Dienstag, den 23.09.2008, 15:34 -0700 schrieb Sudhir:

When I moved from Rail 1.2 to 2.0.2, “script/generate controller xxx”
stopped creating a default layout template in app/view/layouts/. But
the code still works and likely gets a default template for the
controller from somewhere.

Can someone say where this template is stored?

the default template is app/view/layouts/application.html.erb

Greetings
Johannes

On Sep 24, 2:53 am, “Johannes J. Schmidt” [email protected] wrote:

Am Dienstag, den 23.09.2008, 15:34 -0700 schrieb Sudhir:

the default template is app/view/layouts/application.html.erb

Really? I could not find this file in my workspaces. I tried creating
a fresh project and a fresh controller with Rails 2.1.1. It does not
create application.html.erb anywhere in my workspace. Perhaps the file
is elsewhere?

I did find layout.html.erb in my Rails install directory which appears
close to what I would expect from a default view template. I found it
here:
lib/ruby/gems/1.8/gems/rails-2.1.1/lib/rails_generator/generators/
components/scaffold/templates/layout.html.erb

Can anyone confirm that that’s where we need to go to get a default
controller view template? Or maybe there is a “script/generate
default_layout” kind of command to create this in a workspace?

Thanks.

=sudhir.