Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 52 lines (45 sloc) 0.996 kb
ee5ac85 Standardize all examples- remove copyright notice, add require 'rubygems...
Aman Gupta authored
1 require 'rubygems'
2ef9f65 Michael Fellinger added examples for templating in ramaze and erubis, more to come
manveru authored
2 require 'ramaze'
3
264e0f7 Michael Fellinger H.U.G.E. refactoring of the core of Ramaze, beware! don't try this at wo...
manveru authored
4 class MainController < Ramaze::Controller
8b6c3d0 Clive Crous updated spec and example for templates/ezamar
clivecrous authored
5
6 engine :Ezamar
45d6531 Michael Fellinger fixing the ezamar example
manveru authored
7
2ef9f65 Michael Fellinger added examples for templating in ramaze and erubis, more to come
manveru authored
8 def index
8b6c3d0 Clive Crous updated spec and example for templates/ezamar
clivecrous authored
9 %{ #{a('Home',:/)} | #{a(:internal)} | #{a(:external)} }
2ef9f65 Michael Fellinger added examples for templating in ramaze and erubis, more to come
manveru authored
10 end
11
12 def internal *args
13 @args = args
45d6531 Michael Fellinger fixing the ezamar example
manveru authored
14 %q{
2ef9f65 Michael Fellinger added examples for templating in ramaze and erubis, more to come
manveru authored
15 <html>
16 <head>
0685043 Michael Fellinger Ramaze::Template::Ramaze => Ramaze::Template::Ezamar - renaming the temp...
manveru authored
17 <title>Template::Ezamar internal</title>
2ef9f65 Michael Fellinger added examples for templating in ramaze and erubis, more to come
manveru authored
18 </head>
19 <body>
8a3b136 Michael Fellinger unify all examples for templates, preparation for big templating-refacto...
manveru authored
20 <h1>The internal Template for Ezamar</h1>
8b6c3d0 Clive Crous updated spec and example for templates/ezamar
clivecrous authored
21 #{a('Home',:/)}
2ef9f65 Michael Fellinger added examples for templating in ramaze and erubis, more to come
manveru authored
22 <p>
23 Here you can pass some stuff if you like, parameters are just passed like this:<br />
8b6c3d0 Clive Crous updated spec and example for templates/ezamar
clivecrous authored
24 #{a("internal/one")}<br />
25 #{a("internal/one/two/three")}<br />
26 #{a("internal/one?foo=bar")}<br />
2ef9f65 Michael Fellinger added examples for templating in ramaze and erubis, more to come
manveru authored
27 </p>
28 <div>
29 The arguments you have passed to this action are:
30 <?r if @args.empty? ?>
31 none
32 <?r else ?>
33 <?r @args.each do |arg| ?>
34 <span>#{arg}</span>
35 <?r end ?>
36 <?r end ?>
37 </div>
38 <div>
39 #{request.params.inspect}
40 </div>
41 </body>
42 </html>
43 }
44 end
45
46 def external *args
47 @args = args
48 end
49 end
45d6531 Michael Fellinger fixing the ezamar example
manveru authored
50
1a28d42 Clive Crous Explicitly specify path in template examples
clivecrous authored
51 Ramaze.start :file => __FILE__
Something went wrong with that request. Please try again.