Sha256: da31157565737dd72e36afdcd3d3f07b13edfa3094cabd82e7db3e50ffb1dd7e

Contents?: true

Size: 1.03 KB

Versions: 37

Compression:

Stored size: 1.03 KB

Contents

require 'rubygems'
require 'ramaze'

class MainController < Ramaze::Controller
  engine :Erubis

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

  def internal *args
    @args = args
    @place = :internal
    %{
<html>
  <head>
    <title>Template::Erubis #@place</title>
  </head>
  <body>
  <h1>The #@place Template for Erubis</h1>
    <%= 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/two/three") %><br />
      <%= a("#@place/one?foo=bar") %><br />
    </p>
    <div>
      The arguments you have passed to this action are:
      <% if @args.empty? %>
        none
      <% else %>
        <% @args.each do |arg| %>
          <span><%= arg %></span>
        <% end %>
      <% end %>
    </div>
    <div>
      <%= request.params.inspect %>
    </div>
  </body>
</html>
    }
  end

  def external *args
    @args = args
    @place = :external
  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_erubis.rb
Pistos-ramaze-2009.04.08 examples/templates/template_erubis.rb
Pistos-ramaze-2009.06.12 examples/templates/template_erubis.rb
manveru-ramaze-2009.04.01 examples/templates/template_erubis.rb
manveru-ramaze-2009.04.08 examples/templates/template_erubis.rb
manveru-ramaze-2009.04.18 examples/templates/template_erubis.rb
manveru-ramaze-2009.04.22 examples/templates/template_erubis.rb
manveru-ramaze-2009.04 examples/templates/template_erubis.rb
manveru-ramaze-2009.05.08 examples/templates/template_erubis.rb
manveru-ramaze-2009.05 examples/templates/template_erubis.rb
manveru-ramaze-2009.06.04 examples/templates/template_erubis.rb
manveru-ramaze-2009.06.12 examples/templates/template_erubis.rb
manveru-ramaze-2009.06 examples/templates/template_erubis.rb
manveru-ramaze-2009.07 examples/templates/template_erubis.rb
rjspotter-ramaze-2009.06.29 examples/templates/template_erubis.rb
rjspotter-ramaze-2009.06.31 examples/templates/template_erubis.rb
ramaze-2012.12.08 examples/templates/template_erubis.rb
ramaze-2012.12.08b examples/templates/template_erubis.rb
ramaze-2012.04.14 examples/templates/template_erubis.rb
ramaze-2012.03.07 examples/templates/template_erubis.rb