Skip to content

Commit d703407

Browse files
committed
正常显示代码和列表
1 parent 6bc4cad commit d703407

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

source/zh-CN/layouts_and_rendering.md

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -488,43 +488,43 @@ end
488488
* `application_controller.rb`
489489

490490
```ruby
491-
class ApplicationController < ActionController::Base
492-
layout "main"
493-
end
494-
```
491+
class ApplicationController < ActionController::Base
492+
layout "main"
493+
end
494+
```
495495

496496
* `posts_controller.rb`
497497

498498
```ruby
499-
class PostsController < ApplicationController
500-
end
501-
```
499+
class PostsController < ApplicationController
500+
end
501+
```
502502

503503
* `special_posts_controller.rb`
504504

505505
```ruby
506-
class SpecialPostsController < PostsController
507-
layout "special"
508-
end
509-
```
506+
class SpecialPostsController < PostsController
507+
layout "special"
508+
end
509+
```
510510

511511
* `old_posts_controller.rb`
512512

513513
```ruby
514-
class OldPostsController < SpecialPostsController
515-
layout false
516-
517-
def show
518-
@post = Post.find(params[:id])
519-
end
520-
521-
def index
522-
@old_posts = Post.older
523-
render layout: "old"
524-
end
525-
# ...
526-
end
527-
```
514+
class OldPostsController < SpecialPostsController
515+
layout false
516+
517+
def show
518+
@post = Post.find(params[:id])
519+
end
520+
521+
def index
522+
@old_posts = Post.older
523+
render layout: "old"
524+
end
525+
# ...
526+
end
527+
```
528528

529529
在这个程序中:
530530

@@ -754,8 +754,7 @@ Rails 程序或引擎中的 JavaScript 文件可存放在三个位置:`app/ass
754754

755755
Rails 生成的 `script` 标签如下:
756756

757-
{:lang="html"}
758-
```
757+
```html
759758
<script src='/assets/main.js'></script>
760759
```
761760

0 commit comments

Comments
 (0)