Sha256: a676af0fa723645c42cc0d5fa649d3224e898b1a545a8b9dc1976f94e64e66c5

Contents?: true

Size: 993 Bytes

Versions: 8

Compression:

Stored size: 993 Bytes

Contents

require 'rubygems'
require 'ramaze'

class MainController < Ramaze::Controller
  view_root __DIR__/:template
  engine :Haml

  def index
    %{#{A 'Home', :href => :/} | #{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', :href => :/)
    %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

Version data entries

8 entries across 8 versions & 4 rubygems

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