Sha256: a06c2e28a6460630cfabc460e50c330fd7d1402448098e67b0ad2572dab22649

Contents?: true

Size: 961 Bytes

Versions: 37

Compression:

Stored size: 961 Bytes

Contents

require 'rubygems'
require 'ramaze'

class MainController < Ramaze::Controller
  engine :Haml

  def index
    %{#{a('Home',:/)} | #{a(:internal)} | #{a(:external)}}
  end

  def internal *args
    @args = args
    @place = :internal
    @title = "The #@place Template for Haml"

    %q{
%html
  %head
    %title= "Template::Haml #@place"
  %body
    %h1= @title
    = a('Home',:/)
    %p
      Here you can pass some stuff if you like, parameters are just passed like this:
      %br/
      = a("#@place/one")
      %br/
      = a("#@place/one/two/three")
      %br/
      = a("#@place/one?foo=bar")
    %div
      The arguments you have passed to this action are:
      - if @args.empty?
        none
      - else
        - @args.each do |arg|
          %span= arg
    %div= request.params.inspect
    }
  end

  def external *args
    @args = args
    @place = :external
    @title = "The #@place Template for Haml"
  end
end

Ramaze.start :file => __FILE__

Version data entries

37 entries across 37 versions & 4 rubygems

Version Path
ramaze-2023.01.06 examples/templates/template_haml.rb
Pistos-ramaze-2009.04.08 examples/templates/template_haml.rb
Pistos-ramaze-2009.06.12 examples/templates/template_haml.rb
manveru-ramaze-2009.04.01 examples/templates/template_haml.rb
manveru-ramaze-2009.04.08 examples/templates/template_haml.rb
manveru-ramaze-2009.04.18 examples/templates/template_haml.rb
manveru-ramaze-2009.04.22 examples/templates/template_haml.rb
manveru-ramaze-2009.04 examples/templates/template_haml.rb
manveru-ramaze-2009.05.08 examples/templates/template_haml.rb
manveru-ramaze-2009.05 examples/templates/template_haml.rb
manveru-ramaze-2009.06.04 examples/templates/template_haml.rb
manveru-ramaze-2009.06.12 examples/templates/template_haml.rb
manveru-ramaze-2009.06 examples/templates/template_haml.rb
manveru-ramaze-2009.07 examples/templates/template_haml.rb
rjspotter-ramaze-2009.06.29 examples/templates/template_haml.rb
rjspotter-ramaze-2009.06.31 examples/templates/template_haml.rb
ramaze-2012.12.08 examples/templates/template_haml.rb
ramaze-2012.12.08b examples/templates/template_haml.rb
ramaze-2012.04.14 examples/templates/template_haml.rb
ramaze-2012.03.07 examples/templates/template_haml.rb