Sha256: 3b28783915dd900a6efed4aab56f61c5b643b85527b708e33543450463a76583

Contents?: true

Size: 1.27 KB

Versions: 8

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

8 entries across 8 versions & 4 rubygems

Version Path
Pistos-ramaze-2008.09 examples/templates/template_xslt.rb
clivecrous-ramaze-0.3.9.5 examples/templates/template_xslt.rb
manveru-ramaze-2008.07 examples/templates/template_xslt.rb
manveru-ramaze-2008.08 examples/templates/template_xslt.rb
manveru-ramaze-2008.09 examples/templates/template_xslt.rb
manveru-ramaze-2008.10 examples/templates/template_xslt.rb
ramaze-2008.06 examples/templates/template_xslt.rb
ramaze-2008.11 examples/templates/template_xslt.rb