Sha256: 3dbed865cecd124fd8f540bb9e6406f15e1f55144bc657ece66cff64996fd827

Contents?: true

Size: 1008 Bytes

Versions: 3

Compression:

Stored size: 1008 Bytes

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'

include Ramaze

# TODO:
#   - implement the amrita2 example, man, this engine is awkward :P

class MainController < Controller
  template_root File.expand_path((File.dirname(__FILE__)/'template'))
  trait :engine => Template::Amrita2

  def index
    %{ #{A(Rs())} | #{Rs(:internal)} | #{Rs(:external)} }
  end

  def title
    "The external Template for Amrita2"
  end

  def link_home
    A('Home', :href => '/')
  end

  def link_one
    A('/external/one', :href => Rs(:external, :one))
  end

  def link_two
    A("/external/one/two/three", :href => Rs(:external, :one, :two, :three))
  end

  def link_three
    A("/external?foo=bar", :href => Rs(:external, :one, :foo => :bar))
  end

  def inspect_parameters
    request.params.inspect
  end

  def args
    @params.map{|arg| "<span>#{arg}</span>"}.join(' ')
  end
end

Ramaze.start

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ramaze-0.1.3 examples/templates/template_amrita2.rb
ramaze-0.1.1 examples/templates/template_amrita2.rb
ramaze-0.1.2 examples/templates/template_amrita2.rb