[ANN] Request Routing Plugin ( :requirements => { :subdomain


#1

Hi All,

Just a quick note to say that I’ve released an intial version of the
request routing plugin which essentially allows you to use various
request object properties as requirements in routes. Most notably you
can do:

map.connect “thing”, :controller => ‘main’, :requirements => {
:subdomain => ‘whatever’ }

…just like the wiki claims you can do but you can’t :slight_smile:

It exposes several other request methods as well like domain, port,
method etc. and excepts Regexps as well as strings for matching.

SVN: http://svn.vivabit.net/external/rubylibs/request_routing/
README: http://svn.vivabit.net/external/rubylibs/request_routing/README

Cheers,

Dan


#2

Thanks for this! I’ve been wanting something like this for a while.

Published at http://agilewebdevelopment.com/plugins/request_routing :slight_smile:


Benjamin C.
http://www.bencurtis.com/
http://www.tesly.com/ – Collaborative test case management
http://www.agilewebdevelopment.com/ – Resources for the Rails community


#3

Excellent… I was actually thinking on how to do this earlier
today… :slight_smile:

On 5/18/06, Dan W. removed_email_address@domain.invalid wrote:

…just like the wiki claims you can do but you can’t :slight_smile:


Dan W.
http://www.danwebb.net


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#4

Let me know if you have any problems. The rails routing code is a
dark art. I’m using it in a large project and it’s working well and
it passes all my tests so it’s looking good but any feedback would be
great.

Thanks for putting it up on agilewebdev, Ben. I forgot about that.

Cheers,

Dan


#5

I was just wondering about one thing here since you are such a routing
expert. Can I use this in some way or how is the best way to display
controller based on subdomain.
i.e.
Rendering http://UserName.mydomain.com/ as
/UserController/ShowAction/UserName

On 5/18/06, Dan W. removed_email_address@domain.invalid wrote:

http://lists.rubyonrails.org/mailman/listinfo/rails
http://lists.rubyonrails.org/mailman/listinfo/rails