Skip to content

Commit 0a9ae20

Browse files
committed
Refine README.md
1 parent 2b5f4d6 commit 0a9ae20

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,9 @@ module Rails
468468
end
469469
```
470470

471-
As we see in the Rack middleware stack, the last one is `@app=#<ActionDispatch::Routing::RouteSet:0x00007fa1e594cbe8>`
471+
As we see in the Rack middleware stack, the last one is
472+
473+
`@app=#<ActionDispatch::Routing::RouteSet:0x00007fa1e594cbe8>`
472474
```ruby
473475
# ./gems/actionpack5.2.2/lib/action_dispatch/routing/route_set.rb
474476
module ActionDispatch
@@ -570,7 +572,8 @@ module ActionDispatch
570572
def serve(req)
571573
params = req.path_parameters # params: { action: 'index', controller: 'home' }
572574
controller = controller(req) # controller: HomeController
573-
res = controller.make_response!(req) # The definition of make_response! is ActionDispatch::Response.create.tap do |res| res.request = request; end
575+
# The definition of make_response! is ActionDispatch::Response.create.tap do |res| res.request = request; end
576+
res = controller.make_response!(req)
574577
dispatch(controller, params[:action], req, res) # Let's step into this line.
575578
rescue ActionController::RoutingError
576579
if @raise_on_name_error
@@ -1143,7 +1146,7 @@ end
11431146

11441147
It's time to answer the question before:
11451148

1146-
How can this instance variable defined '@users' in HomeController be accessed in './app/views/home/index.html.erb' ?
1149+
How can instance variable like `@users` defined in `HomeController` be accessed in `./app/views/home/index.html.erb`?
11471150

11481151
```ruby
11491152
# ./gems/actionview-5.2.2/lib/action_view/rendering.rb
@@ -1236,7 +1239,7 @@ end
12361239

12371240
```
12381241

1239-
## Part 4: What `$ rails server` do?
1242+
## Part 4: What does `$ rails server` do?
12401243
Assume your rails project app class name is `YourProject::Application` (defined in `./config/application.rb`).
12411244

12421245
First, I will give you a piece of important code.
@@ -1268,7 +1271,7 @@ module Rails
12681271
end
12691272
```
12701273

1271-
Then, Let's start rails by `rails server`. The command `rails` locates at `./bin/`.
1274+
Then, let's start rails by `rails server`. The command `rails` locates at `./bin/`.
12721275
```ruby
12731276
#!/usr/bin/env ruby
12741277
APP_PATH = File.expand_path('../config/application', __dir__)
@@ -1591,6 +1594,6 @@ module Rack
15911594
end
15921595
end
15931596
```
1594-
Now puma has been started successfully running your app (instance of YourProject::Application).
1597+
Now puma has been started successfully with your app (instance of YourProject::Application) running.
15951598

15961599

0 commit comments

Comments
 (0)