rails/rails — pull request #3659 by huacnlee (2011-11-17 11:19:10+00:00)
Title: Improve for scaffold controller generator

added _base.html.erb for every page, then we can define some common html(CSS/JS include, Javascript) in it.

for example:

There have a messages controller

_base.html.erb
```
<%= content_for :breadcrumb do %>
Messages >
<% end %>
<%= content_for :css do %>
<%= stylesheet_link_tag "messages" %>
<% end %>
<%= content_for :js do %>
<%= javascript_include_tag "messages" %>
<% end %>
```

new.html.erb
```
<%= content_for :breadcrumb do %>
New
<% end %>
<%= render "base" %>
...
```

index.html.erb
```
<%= content_for :breadcrumb do %>
List
<% end %>
<%= render "base" %>
...
```

show.html.ern
```
<%= content_for :breadcrumb do %>
View
<% end %>
<%= render "base" %>
...
```

And in the Layout
application.html.erb
```

<%= stylesheet_link_tag "application" %>
<%= yield :css %>
<%= javascript_include_tag "application" %>
<%= yield :js %>

Location: Root > <%= yield :breadcrumb %>

```