Sha256: 158c254229c717aafb79ced1bc0d18633df1c43f4946054bee6a672fd1ba335b

Contents?: true

Size: 1.27 KB

Versions: 10

Compression:

Stored size: 1.27 KB

Contents

require 'rubygems'
require 'ramaze'
require 'ramaze/gestalt'

class MainController < Ramaze::Controller
  view_root __DIR__(:template)
  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

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
Pistos-ramaze-2008.12 examples/templates/template_xslt.rb
Pistos-ramaze-2009.01 examples/templates/template_xslt.rb
Pistos-ramaze-2009.02 examples/templates/template_xslt.rb
manveru-ramaze-2008.12 examples/templates/template_xslt.rb
manveru-ramaze-2009.01 examples/templates/template_xslt.rb
ptomato-ramaze-2009.02.1 examples/templates/template_xslt.rb
ptomato-ramaze-2009.02 examples/templates/template_xslt.rb
ramaze-2009.01 examples/templates/template_xslt.rb
ramaze-2009.02 examples/templates/template_xslt.rb
ramaze-2009.03 examples/templates/template_xslt.rb