summaryrefslogtreecommitdiffstats
path: root/examples/sample.ru
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-09-11 00:47:01 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-09-11 01:03:24 +0200
commitcfe72087d3179c2e80f923f9061d9450714a1547 (patch)
treedfdf53ce9e578713bf7a1db8d9c304a581fa704a /examples/sample.ru
parent889cdf7749217c0425e2984cf13d7791ad79cb48 (diff)
downloadzorglub-cfe72087d3179c2e80f923f9061d9450714a1547.zip
zorglub-cfe72087d3179c2e80f923f9061d9450714a1547.tar.gz
implement Node#redirect + add tests in sample.ru
Diffstat (limited to 'examples/sample.ru')
-rw-r--r--examples/sample.ru7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/sample.ru b/examples/sample.ru
index 5692ef5..00d1b7a 100644
--- a/examples/sample.ru
+++ b/examples/sample.ru
@@ -42,6 +42,10 @@ class Node1 < Zorglub::Node
"<b>should never be seeen</b>"
end
#
+ def jump *args
+ redirect r(:index,1,2,3)
+ end
+ #
end
#
APP = Zorglub::App.new do
@@ -106,7 +110,7 @@ class Node0 < Zorglub::Node
#
def index
html = "<html><body><ul>"
- html << "<li><a href=\"#{Node1.r('index','a',2,'c')}\">Node1</a> engine, layout, view tests</li>"
+ html << "<li><a href=\"#{Node1.r('index','a',2,'c')}\">Node1</a> engine, layout, view, redirect tests</li>"
html << "<li><a href=\"#{Node2.r}\">Node2</a> css helper tests</li>"
html << "<li><a href=\"#{Node3.r}\">Node3</a> session test</li>"
html << "</ul></body></html>"
@@ -119,6 +123,7 @@ Node1::LINKS= [
[Node1.r('index','arg1','arg2','arg3'),'index'],
[Node1.r('meth0'),'meth0'],
[Node1.r('meth1','one','two'),'meth1 with args'],
+ [Node1.r('jump','one','two'),'test redirect'],
[Node0.r,'back'],
]
#