File tree Expand file tree Collapse file tree 1 file changed +26
-27
lines changed Expand file tree Collapse file tree 1 file changed +26
-27
lines changed Original file line number Diff line number Diff line change @@ -488,43 +488,43 @@ end
488
488
* ` application_controller.rb `
489
489
490
490
``` ruby
491
- class ApplicationController < ActionController ::Base
492
- layout " main"
493
- end
494
- ```
491
+ class ApplicationController < ActionController ::Base
492
+ layout " main"
493
+ end
494
+ ```
495
495
496
496
* ` posts_controller.rb `
497
497
498
498
``` ruby
499
- class PostsController < ApplicationController
500
- end
501
- ` ` `
499
+ class PostsController < ApplicationController
500
+ end
501
+ ```
502
502
503
503
* ` special_posts_controller.rb `
504
504
505
505
``` ruby
506
- class SpecialPostsController < PostsController
507
- layout "special"
508
- end
509
- ` ` `
506
+ class SpecialPostsController < PostsController
507
+ layout " special"
508
+ end
509
+ ```
510
510
511
511
* ` old_posts_controller.rb `
512
512
513
513
``` 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
+ ```
528
528
529
529
在这个程序中:
530
530
@@ -754,8 +754,7 @@ Rails 程序或引擎中的 JavaScript 文件可存放在三个位置:`app/ass
754
754
755
755
Rails 生成的 ` script ` 标签如下:
756
756
757
- {: lang ="html"}
758
- ```
757
+ ``` html
759
758
<script src =' /assets/main.js' ></script >
760
759
```
761
760
You can’t perform that action at this time.
0 commit comments