Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
Signed-off-by: blindgaenger <blindgaenger@gmail.com>
  • Loading branch information
mattpuchlerz authored and blindgaenger committed May 10, 2009
1 parent 7188123 commit 244e2b5
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions README.textile
Expand Up @@ -47,27 +47,25 @@ on your model, *appropriate routing and redirecting* and *named url helpers*.
For instance, you can imagine the following code to be added for the @/people@
and @/people/:id@ routes.

<pre>
<code>
# simply add this line

rest Person, :renderer => :erb

# and this is generated for you

get '/people' do
@people = Person.all
erb :"people/index", options
end

put '/people/:id' do
@person = Person.find_by_id(params[:id])
redirect url_for_people_show(@person), 'person updated'
end

# further restful routes for Person ...
</code>
</pre>
<pre><code>
# simply add this line

rest Person, :renderer => :erb

# and this is generated for you

get '/people' do
@people = Person.all
erb :"people/index", options
end

put '/people/:id' do
@person = Person.find_by_id(params[:id])
redirect url_for_people_show(@person), 'person updated'
end

# further restful routes for Person ...
</code></pre>

That's only half the truth! The routes are generated dynamically, so all
defaults can be overridden (the behaviour, after/before callbacks, used renderer,
Expand Down

0 comments on commit 244e2b5

Please sign in to comment.