Wrox Programmer Forums
|
BOOK: Beginning Ruby on Rails
This is the forum to discuss the Wrox book Beginning Ruby on Rails by Steve Holzner Ph.D.; ISBN: 9780470069158
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Ruby on Rails section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2009, 08:32 PM
Registered User
 
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 09 router app error

I am receiving the following routing error when attempting to connect to http://localhost:3000/look/at/15/11/2007:

Routing Error

no route found to match "/look/at/15/11/2007" with {:method=>:get}___________________

Here's what I have for Ch09/router/config/routes.rb (comments redacted):

ActionController::Routing::Routes.draw do |map|

map.connect ':controller/service.wsdl', :action => 'wsdl'

map.connect ':controller/:action/:id'

map.connect "look/at/:day/:month/:year",
:controller => "look",
:action => "at",
:requirements => {:year => / (19|20)\d\d/}

map.connect "anything",
:controller => "look",
:action => "unknown_request"
end
_____________
Here's my at.rhtml code:

<html>
<head>
<title>Routing requirements</title>
</head>

<body>
<h1>Routing Requests</h1>
<br>
Day: <%= @day %>
<br>
Month: <%= @month %>
<br>
Year: <%= @year %>
<br>
</body>
</html>

____________

Routing words just fine for http://localhost:3000/look/at/:

Routing Requests


Day:
Month:
Year:


But it seems to break down as soon as I add the additional day/month/year routing.





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to detect router ip pikachew Classic ASP Basics 4 July 5th, 2007 08:29 PM
Login To ADSL Router ibmsuh VB.NET 0 November 7th, 2006 06:12 AM
CH 09 AjaxMail SQL coders4hire BOOK: Professional Ajax ISBN: 978-0-471-77778-6 2 June 22nd, 2006 08:03 PM
Dynamic IP of Router jack_3 C# 0 November 15th, 2005 10:02 PM
Winsock Problem when server run behind the router mihir9274 VB Components 0 November 29th, 2003 05:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.