Skip to content

Commit

Permalink
update for yesod 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yogsototh committed Apr 11, 2012
1 parent 796cd3f commit b4021bb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions multi/blog/Yesod-tutorial-for-newbies.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ Let's take a look at the file `config/routes`:
/favicon.ico FaviconR GET
/robots.txt RobotsR GET

/ RootR GET
/ HomeR GET
</pre>

We want to add a route of the form `/echo/[anything]` somehow and do some action with this.
Expand All @@ -269,7 +269,7 @@ Application.hs:31:1: Not in scope: `getEchoR'
</pre>

Why? Simply because we didn't written the code for the handler `EchoR`.
Edit the file `Handler/Root.hs` and append this:
Edit the file `Handler/Home.hs` and append this:

<code class="haskell">
getEchoR :: String -> Handler RepHtml
Expand Down Expand Up @@ -389,17 +389,17 @@ getEchoR theText = do
[whamlet|<h1>#{theText}|]
</code>

Do not forget to remove the getEchoR function inside `Handler/Root.hs`.
Do not forget to remove the getEchoR function inside `Handler/Home.hs`.

We must declare this new file into`yosog.cabal`.
Just after `Handler.Root`, add:
Just after `Handler.Home`, add:

<pre>
Handler.Echo
</pre>

We must also declare this new Handler module inside `Application.hs`.
Just after the "`import Handler.Root`", add:
Just after the "`import Handler.Home`", add:

<code class="haskell">
import Handler.Echo
Expand Down

0 comments on commit b4021bb

Please sign in to comment.