Dan Webb
2006-May-18 13:40 UTC
[Rails] [ANN] Request Routing Plugin ( :requirements => { :subdomain => ''thing'' } finally works)
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 :) 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 -- Dan Webb http://www.danwebb.net
Benjamin Curtis
2006-May-18 14:18 UTC
[Rails] [ANN] Request Routing Plugin ( :requirements => { :subdomain => ''thing'' } finally works)
Thanks for this! I''ve been wanting something like this for a while. Published at http://agilewebdevelopment.com/plugins/request_routing :) -- Benjamin Curtis http://www.bencurtis.com/ http://www.tesly.com/ -- Collaborative test case management http://www.agilewebdevelopment.com/ -- Resources for the Rails community On May 18, 2006, at 6:40 AM, Dan Webb wrote:> 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 :) > > 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 > > -- > Dan Webb > http://www.danwebb.net > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Jon Gretar Borgthorsson
2006-May-18 14:22 UTC
[Rails] [ANN] Request Routing Plugin ( :requirements => { :subdomain => ''thing'' } finally works)
Excellent..... I was actually thinking on how to do this earlier today.... :) On 5/18/06, Dan Webb <dan@danwebb.net> wrote:> 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 :) > > 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 > > -- > Dan Webb > http://www.danwebb.net > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -------------- Jon Gretar Borgthorsson http://www.jongretar.net/
Dan Webb
2006-May-18 15:34 UTC
[Rails] [ANN] Request Routing Plugin ( :requirements => { :subdomain => ''thing'' } finally works)
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 On 5/18/06, Jon Gretar Borgthorsson <jon.borgthorsson@gmail.com> wrote:> Excellent..... I was actually thinking on how to do this earlier today.... :) > > On 5/18/06, Dan Webb <dan@danwebb.net> wrote: > > 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 :) > > > > 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 > > > > -- > > Dan Webb > > http://www.danwebb.net > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > -------------- > Jon Gretar Borgthorsson > http://www.jongretar.net/ > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Dan Webb http://www.danwebb.net
Jon Gretar Borgthorsson
2006-May-18 15:41 UTC
[Rails] [ANN] Request Routing Plugin ( :requirements => { :subdomain => ''thing'' } finally works)
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 Webb <dan@danwebb.net> wrote:> 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 > > On 5/18/06, Jon Gretar Borgthorsson <jon.borgthorsson@gmail.com> wrote: > > Excellent..... I was actually thinking on how to do this earlier today.... :) > > > > On 5/18/06, Dan Webb <dan@danwebb.net> wrote: > > > 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 :) > > > > > > 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 > > > > > > -- > > > Dan Webb > > > http://www.danwebb.net > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > > -------------- > > Jon Gretar Borgthorsson > > http://www.jongretar.net/ > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > Dan Webb > http://www.danwebb.net > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -------------- Jon Gretar Borgthorsson http://www.jongretar.net/