Sha256: cc59ef942b2eeb674b6dcbae6a1f7fe414a563ebb8cf27547d4856d073c7e1b5
Contents?: true
Size: 1.24 KB
Versions: 3
Compression:
Stored size: 1.24 KB
Contents
# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com # All files in this distribution are subject to the terms of the Ruby license. require 'ramaze' class MainController < Ramaze::Controller template_root File.expand_path((File.dirname(__FILE__)/'template')) trait :engine => Ramaze::Template::Erubis def index %{ #{A('Home', :href => :/)} | #{A(:internal)} | #{A(:external)} } end def internal *args @args = args @place = :internal %q{ <html> <head> <title>Template::Erubis internal</title> </head> <body> <h1>The internal Template for Erubis</h1> <%= A('Home', :href => :/) %> <p> Here you can pass some stuff if you like, parameters are just passed like this:<br /> <%= A("/#@place/one") %><br /> <%= A("#@place/two/three") %><br /> <%= A("#@place/one?foo=bar") %><br /> </p> <div> The arguments you have passed to this action are: <% if @args.empty? %> none <% else %> <% @args.each do |arg| %> <span><%= arg %></span> <% end %> <% end %> </div> <div> <%= request.params.inspect %> </div> </body> </html> } end def external *args @args = args @place = :external end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ramaze-0.1.2 | examples/templates/template_erubis.rb |
ramaze-0.1.1 | examples/templates/template_erubis.rb |
ramaze-0.1.3 | examples/templates/template_erubis.rb |