Commit 0beed242bd3452616b219cc98ae48b90847a2707
- Diff rendering mode:
- inline
- side by side
|   | |||
| 32 | 32 | [ADDED] spec/requests/birds_spec.rb | |
| 33 | 33 | [ADDED] app/helpers/birds_helper.rb | |
| 34 | 34 | {:lang=shell html_use_syntax=true} | |
| 35 | |||
| 35 | |||
| 36 | 36 | or | |
| 37 | 37 | ||
| 38 | $ merb-gen resource_controller | ||
| 38 | $ merb-gen resource_controller | ||
| 39 | 39 | {:lang=shell html_use_syntax=true} | |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | The first command will generate a controller with an ``index action`` and | ||
| 42 | The first command will generate a controller with an ``index action`` and | ||
| 43 | 43 | an ``index view``(template). | |
| 44 | |||
| 44 | |||
| 45 | 45 | +-- {: .notes} | |
| 46 | 46 | If you realized you made a mistake when generating your controller, | |
| 47 | 47 | You can delete the generated controller by appending ``-d`` at the |
|   | |||
| 26 | 26 | ||
| 27 | 27 | ## Reverse Proxy (optional) | |
| 28 | 28 | ||
| 29 | The first stop for a request in a live application is usually a reverse proxy like | ||
| 29 | The first stop for a request in a live application is usually a reverse proxy like | ||
| 30 | 30 | [NginX][] or [Apache mod\_proxy][]. | |
| 31 | 31 | Depending on the setup, these proxies may serve static files like images, | |
| 32 | 32 | CSS style sheets, JavaScript, videos etc. | |
| … | … | ||
| 72 | 72 | The request then sends itself to the controller. | |
| 73 | 73 | ||
| 74 | 74 | The Router's job is to set up parameters extracted from the request | |
| 75 | and to tell the request where to go. | ||
| 75 | and to tell the request where to go. | ||
| 76 | 76 | In most cases, the router maps a request to a controller method (action) and also | |
| 77 | 77 | sets up parameters extracted from the request. | |
| 78 | 78 |
book-content/en/toc.markdown
(1 / 1)
|   | |||
| 10 | 10 | However, with the help of the Ruby Community, we will be able to cover most | |
| 11 | 11 | of what you need to use Merb on a daily basis. | |
| 12 | 12 | ||
| 13 | If you are learning through this material, or if you already use Merb | ||
| 13 | If you are learning through this material, or if you already use Merb | ||
| 14 | 14 | frequently, **please consider helping improve the content of this book**. | |
| 15 | 15 | =-- | |
| 16 | 16 |

