forked from manveru/ramaze
-
Notifications
You must be signed in to change notification settings - Fork 37
/
template_xslt.rb
48 lines (43 loc) · 1.26 KB
/
template_xslt.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
require 'rubygems'
require 'ramaze'
require 'ramaze/gestalt'
class MainController < Ramaze::Controller
engine :XSLT
def index
redirect R(:external)
end
def external *args
r = lambda { |*a| R(*a) }
response['Content-Type'] = 'application/xhtml+xml'
#options = {:place => :internal, :action => 'internal',
# :args => args, :request => request, :this => self}
Ramaze::Gestalt.build do
page(:title=>"Template::XSLT") do
heading "The external Template for XSLT"
text "Here you can pass some stuff if you like, parameters are just passed like this:"
list do
item {
link(:href => r.call(@this, :external, :one)) { "external/one" }
}
item {
link(:href => r.call(@this, :external, :one, :two, :three)) { "external/one/two/three" }
}
item {
link(:href => r.call(@this, :external, :one, :foo => :bar)) { "external/one?foo=bar" }
}
end
text "The arguments you have passed to this action are:"
if args.empty?
text "none"
else
list {
args.each do |arg|
item arg
end
}
end
end
end
end
end
Ramaze.start :file => __FILE__