mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Explain meaning of the code very well and Remove confusion. [ci skip]
Code like `render(topics) => render("topics/topic")` adds confusion for the readers. On first impression, that code feels like hash kind of data, but it's not. So make it more clear and meaningful.
This commit is contained in:
parent
cf5bc0dd53
commit
8ad6260538
2 changed files with 8 additions and 8 deletions
|
@ -69,11 +69,11 @@ module ActionView
|
|||
# render 'comments/comments'
|
||||
# render('comments/comments')
|
||||
#
|
||||
# render "header" => render("comments/header")
|
||||
# render "header" translates to render("comments/header")
|
||||
#
|
||||
# render(@topic) => render("topics/topic")
|
||||
# render(topics) => render("topics/topic")
|
||||
# render(message.topics) => render("topics/topic")
|
||||
# render(@topic) translates to render("topics/topic")
|
||||
# render(topics) translates to render("topics/topic")
|
||||
# render(message.topics) translates to render("topics/topic")
|
||||
#
|
||||
# It's not possible to derive all render calls like that, though.
|
||||
# Here are a few examples of things that can't be derived:
|
||||
|
|
|
@ -198,11 +198,11 @@ render "comments/comments"
|
|||
render 'comments/comments'
|
||||
render('comments/comments')
|
||||
|
||||
render "header" => render("comments/header")
|
||||
render "header" translates to render("comments/header")
|
||||
|
||||
render(@topic) => render("topics/topic")
|
||||
render(topics) => render("topics/topic")
|
||||
render(message.topics) => render("topics/topic")
|
||||
render(@topic) translates to render("topics/topic")
|
||||
render(topics) translates to render("topics/topic")
|
||||
render(message.topics) translates to render("topics/topic")
|
||||
```
|
||||
|
||||
On the other hand, some calls need to be changed to make caching work properly.
|
||||
|
|
Loading…
Reference in a new issue