Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
alexch committed Dec 11, 2010
1 parent 67b02d6 commit 2f96ea9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions off-the-rails.md
Expand Up @@ -142,7 +142,7 @@ A Rack middleware is a class that is initialized with an app, plus optional argu
## Rackup and config.ru

* `rackup` is a command-line tool that launches a Rack server
* it reads app configuration, in Rack::Builder DSL format, from `config.ru`.
* it reads app configuration, in Rack::Builder DSL format, from a `.ru` file (by default `config.ru`).

`hello_app.ru`:

Expand All @@ -152,6 +152,8 @@ A Rack middleware is a class that is initialized with an app, plus optional argu
use Rack::ShowExceptions
run HelloApp

`rackup hello_app.ru` # will launch a server and run HelloApp with PrintEnv and ShowExceptions

## rerun

* gem written by me
Expand All @@ -165,8 +167,11 @@ A Rack middleware is a class that is initialized with an app, plus optional argu
Very useful object that's built from an env

* params
* path
* media_type
* xhr?
* etc.

## Mixing Apps

* `Rack::Builder` implements the normal Rack `.ru` DSL on the passed-in block and returns an app
Expand Down Expand Up @@ -266,7 +271,7 @@ Yes, that's it. No model, no view, no controller: just a route and a handler blo
redirect "/foo"
end

Note: there is no "controller" *per se* in Sinatra -- just an application and routes and handlers.
Note: there is no "controller" *per se* in Sinatra -- just an application and routes and handlers (and optionally, models and whatever other Ruby objects you require).

## Sinatra DSL Features

Expand Down

0 comments on commit 2f96ea9

Please sign in to comment.