github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

veilleperso / request_routing

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 34
    • 6
  • Source
  • Commits
  • Network (6)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Mirror for rails plugin : request_routing — Read more

  cancel

http://svn.danwebb.net/external/rails/plugins/request_routing/trunk/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

initial move from vivabit repos. 
danwebb (author)
Thu Aug 17 10:07:28 -0700 2006
commit  246fdd63a002da4e1885d53e761bdf38f774c550
tree    20d688b1bbbbec324e34b92e09f9e2c32260bbdc
request_routing /
name age
history
message
file LICENSE Thu Aug 17 10:07:28 -0700 2006 initial move from vivabit repos. git-svn-id:... [danwebb]
file README Thu Aug 17 10:07:28 -0700 2006 initial move from vivabit repos. git-svn-id:... [danwebb]
file Rakefile Thu Aug 17 10:07:28 -0700 2006 initial move from vivabit repos. git-svn-id:... [danwebb]
file init.rb Thu Aug 17 10:07:28 -0700 2006 initial move from vivabit repos. git-svn-id:... [danwebb]
directory lib/ Thu Aug 17 10:07:28 -0700 2006 initial move from vivabit repos. git-svn-id:... [danwebb]
directory tasks/ Thu Aug 17 10:07:28 -0700 2006 initial move from vivabit repos. git-svn-id:... [danwebb]
directory test/ Thu Aug 17 10:07:28 -0700 2006 initial move from vivabit repos. git-svn-id:... [danwebb]
README
Request Routing Plugin for Ruby on Rails
========================================
(c) Dan Webb 2006 (dan@vivabit.com)

Plugin that allows you to define routing conditions that test 
methods/properties of the request object such as subdomain, domain,
port.  You can test them either against a value or with a Regexp
(assuming the method returns a string)

*UPDATE* Now works with the new routing code as implemented in edge rails.  Note the
change in API: use :conditions instead of :requirements.

== Installation

    ruby script/plugin install http://svn.vivabit.net/external/rubylibs/request_routing/

== Usage

In routes.rb you can specify use the :requirements hash with request properties:

    map.connect '', :controller => 'main', :conditions => { :subdomain => 'www' }

    map.connect 'admin', :controller => 'admin', :conditions => { :remote_ip => /^127\.0\.0\.[0-9]$/ }

You can also, of course, use the conditions hash in map.with_options calls.

The allowed properties are:

    :subdomain  (only checks the first subdomain)
    :domain (only accurate for single tld domain names at the moment)
    :method (a symbol)
    :port (a number)
    :remote_ip 
    :content_type (content type of the post body)
    :accepts 
    :request_uri (the entire request uri)
    :protocol (either http:// or https://)

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server