The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
One Small Serving of WebApp Tips

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
One Small Serving of WebApp Tips Posted: Feb 2, 2005 1:25 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: One Small Serving of WebApp Tips
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

Maybe you remember Tanaka-san’s WebApp from a few weeks back. I’ve been using it here on the site to power our posting CGIs. It acts as a very simple wrapper for Hobix, which does the work of refreshing this site’s static HTML efficiently.

Time for a few undocumented tips I’ve picked up while sifting through the source.

  • Set ENV['WEBAPP_DEVELOP_HOST'] to your IP before you require 'webapp'. When exceptions are thrown, you’ll see the exception. Other users will get an error page.
  • Customize the debug and error pages by overriding WebApp::Manager#generate_debug_page and WebApp::Manager#generate_error_page.
  • WebApp works best when paths are addressed after the CGI’s path. Here’s a set of rewrite rules:
     RewriteEngine   On
     RewriteCond %{REQUEST_URI} !webapp.cgi
     RewriteRule ^(.*)$         /posts/webapp.cgi/$1
    
  • If using the above, you can generate links relative to the CGI path by using web.reluri( :path_info => '/posts/list' ).
  • You might want to alias the verbose accessors for GET and POST variables.
     class WebApp
       alias _get  query_html_get_application_x_www_form_urlencoded
       alias _post query_html_post_application_x_www_form_urlencoded
     end
    

Read: One Small Serving of WebApp Tips

Topic: R2C, RSN (no really) Previous Topic   Next Topic Topic: Off the Treadmill, Onto the Rails

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use