Skip to content

Architecture Routes

alsonkemp edited this page Sep 13, 2010 · 1 revision

Much as with Ruby on Rails, Turbinado uses “routes” to direct traffic to particular Controllers. Routes are configured in Config/Routes.hs. A sample set of routes is in Config/Routes.hs.sample, which contains:

module Config.Routes where

routes = [ "/:controller/:action/:id"
         , "/:controller/:action.:format"
         , "/:controller/:action"
         , "/:controller"
         ]

Using these routes, a request to


/Page/Show/title

would:
  1. Insert into the Settings:
    o “controller” => “Page”
    o “action” => “Show”
    o “id” => “title”
  2. Invoke the “show” function in /App/Controllers/Page.hs. Presumably, the controller would want to getSetting “id”.
  3. Invoke the “markup” function in /App/Views/Page/Show.hs
Clone this wiki locally