Skip to content

Commit

Permalink
Removed mentions of controller specific layouts. Ticket Ref: http://b…
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitarondekar committed Apr 25, 2010
1 parent 606bed1 commit a595519
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions railties/guides/source/getting_started.textile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ The scaffold generator will build 15 files in your application, along with some
|app/views/posts/show.html.erb |A view to display a single post| |app/views/posts/show.html.erb |A view to display a single post|
|app/views/posts/new.html.erb |A view to create a new post| |app/views/posts/new.html.erb |A view to create a new post|
|app/views/posts/_form.html.erb |A partial to control the overall look and feel of the form used in edit and new views| |app/views/posts/_form.html.erb |A partial to control the overall look and feel of the form used in edit and new views|
|app/views/layouts/posts.html.erb |A view to control the overall look and feel of the other post views|
|app/helpers/posts_helper.rb |Helper functions to be used from the post views| |app/helpers/posts_helper.rb |Helper functions to be used from the post views|
|test/unit/post_test.rb |Unit testing harness for the posts model| |test/unit/post_test.rb |Unit testing harness for the posts model|
|test/functional/posts_controller_test.rb |Functional testing harness for the posts controller| |test/functional/posts_controller_test.rb |Functional testing harness for the posts controller|
Expand Down Expand Up @@ -551,19 +550,19 @@ TIP: For more details on the rendering process, see "Layouts and Rendering in Ra


h4. Customizing the Layout h4. Customizing the Layout


The view is only part of the story of how HTML is displayed in your web browser. Rails also has the concept of +layouts+, which are containers for views. When Rails renders a view to the browser, it does so by putting the view's HTML into a layout's HTML. The +rails generate scaffold+ command automatically created a default layout, +app/views/layouts/posts.html.erb+, for the posts. Open this layout in your editor and modify the +body+ tag: The view is only part of the story of how HTML is displayed in your web browser. Rails also has the concept of +layouts+, which are containers for views. When Rails renders a view to the browser, it does so by putting the view's HTML into a layout's HTML. In previous versions of Rails, the +rails generate scaffold+ command would automatically create a controller specific layout, like +app/views/layouts/posts.html.erb+, for the posts controller. However this has been changed in Rails 3.0. A application specific +layout+ is used for all the controllers and can be found in +app/views/layouts/application.html.erb+. Open this layout in your editor and modify the +body+ tag:


<erb> <erb>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Posts: <%= controller.action_name %></title> <title>Blog</title>
<%= stylesheet_link_tag 'scaffold' %> <%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
</head> </head>
<body style="background: #EEEEEE;"> <body style="background: #EEEEEE;">


<p class="notice"><%= notice %></p>

<%= yield %> <%= yield %>


</body> </body>
Expand Down

0 comments on commit a595519

Please sign in to comment.