Dre*_*son 18 ruby-on-rails header footer code-standards
在Rails应用程序中为每个视图添加页眉和页脚的标准方法是什么?
mač*_*ček 26
如果找到此文件,将使用它.
<!doctype html>
<html>
<head>
<!-- stuff -->
</head>
<body>
<!-- this is where content will be rendered -->
<%= yield %>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
否则,您可以拨打另一个电话.
# app/controllers/birds_controller.rb
class BirdsController < ApplicationController
layout :birds # looks for app/views/layouts/birds.html.erb
# ...
end
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14683 次 |
| 最近记录: |