Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > BOOK: Beginning Ruby on Rails
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old January 17th, 2007, 09:07 PM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with ch09 "Creating a filter" example.

On p, 273 there is a "Try It Out" exercise for creating an online filter. I have built everything correctly, and even used the downloaded code, but I can't get the application to display the "now" action when it isn't business hours. Plus, there isn't a "game" action, so I don't understand why step 11 tells you to navigate to http://localhost:3000/play/game. Nevertheless, it works and displays not.rhtml if the time is between 9:00am and 5:00pm as it should, but I changed my system clock to 7:00pm and navigated to http://localhost:3000/play/game and it told me that "no action responded to game". I tried restarting the WEBrick server a couple of times and even tried clearing my cache and cookies, but I think that the example is essentially flawed. Any help would be greatly appreciated.

Thanks.
  #2 (permalink)  
Old February 13th, 2007, 12:53 PM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The action which do not work has a very bad chosen name: "not".
Ther is no "game" action, only a "game" application
with two actions, "now" and "not".

Please use another name for "not", like "noplaynow".
You have to:
1) change the name not in the "play" controller (even if the action
has an empty body)
2) change the call in the controller after :except =>
3) create a view file in app/views/play called "noplaynow.rhtml".

Cheers!
Demitton
  #3 (permalink)  
Old March 26th, 2007, 11:06 AM
Registered User
 
Join Date: Mar 2007
Location: Madison, WI, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

you've made a good observation about the lack of 'game' action. Take it a step further and ask, so what actions are available? You will realize that the navigate to http://localhost:3000/play/game is a typo. It should have been http://localhost:3000/play/now.

Also, check the address line in the accompanying figures, they show the real addresses (no typos there, I think at least).

There is nothing wrong with the application; it works as supposed, you do not need to do any tweaking.

Also, when testing it, you do not need to change system time, it takes considerably longer to change system time back and forth then changing the values of the time range inside the code itself. :)

By the way, the if statement inside the check_time method looks better this way:

(9..17).include? Time.now.hour

divnavoda



Similar Threads
Thread Thread Starter Forum Replies Last Post
BSM scorecard page filter problem saikrishna_80 SharePoint Development 1 February 8th, 2007 04:40 PM
Filter form with date fields problem!! chiefouko Access 2 August 14th, 2006 10:15 AM
Basing one combo on another - filter problem CongoGrey Access 1 May 21st, 2005 10:47 AM
problem with filter form keyvan Classic ASP Databases 1 June 29th, 2003 05:17 AM





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