diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-08-14 12:34:38 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-08-14 12:34:38 -0300 |
commit | 48c1e6d584409d774b184e0f4d2ef28e5b0e9c90 (patch) | |
tree | a2becf0cce37a47579e848780b02f420d335ccd9 /actionpack/examples/very_simple.rb | |
parent | 9ac01fad193b27e517ea772e0d1e13e06f4ddf34 (diff) | |
parent | c6bc8e662614be711f45a8d4b231d5f993b024a7 (diff) | |
download | rails-48c1e6d584409d774b184e0f4d2ef28e5b0e9c90.tar.gz rails-48c1e6d584409d774b184e0f4d2ef28e5b0e9c90.tar.bz2 rails-48c1e6d584409d774b184e0f4d2ef28e5b0e9c90.zip |
Merge commit 'rails/master'
Diffstat (limited to 'actionpack/examples/very_simple.rb')
-rw-r--r-- | actionpack/examples/very_simple.rb | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/actionpack/examples/very_simple.rb b/actionpack/examples/very_simple.rb deleted file mode 100644 index 6714185172..0000000000 --- a/actionpack/examples/very_simple.rb +++ /dev/null @@ -1,50 +0,0 @@ -$:.push "rails/activesupport/lib" -$:.push "rails/actionpack/lib" - -require "action_controller" - -class Kaigi < ActionController::Metal - include AbstractController::Callbacks - include ActionController::RackConvenience - include ActionController::RenderingController - include ActionController::Layouts - include ActionView::Context - - before_filter :set_name - append_view_path "views" - - def view_context - self - end - - def controller - self - end - - DEFAULT_LAYOUT = Object.new.tap {|l| def l.render(*) yield end } - - def render_template(template, layout = DEFAULT_LAYOUT, options = {}, partial = false) - ret = template.render(self, {}) - layout.render(self, {}) { ret } - end - - def index - render :template => "template" - end - - def alt - render :template => "template", :layout => "alt" - end - - private - def set_name - @name = params[:name] - end -end - -app = Rack::Builder.new do - map("/kaigi") { run Kaigi.action(:index) } - map("/kaigi/alt") { run Kaigi.action(:alt) } -end.to_app - -Rack::Handler::Mongrel.run app, :Port => 3000 |