This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails Cheat Sheet | |
# and list of helpers worth keeping | |
# command line | |
script/generate controller | |
# route | |
map.root :controller => "controller_name" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helpers do | |
# Construct a link to +url_fragment+, which should be given relative to | |
# the base of this Sinatra app. The mode should be either | |
# <code>:path_only</code>, which will generate an absolute path within | |
# the current domain (the default), or <code>:full_url</code>, which will | |
# include the site name and port number. The latter is typically necessary | |
# for links in RSS feeds. Example usage: | |
# | |
# link_to "/foo" # Returns "http://example.com/myapp/foo" | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'rack' | |
# todo | |
# - detect ssl | |
# - keepalive? | |
module Rack | |
class Forwarder | |
def initialize(host, port=80) |
NewerOlder