I've got problem on open URL http://localhost:3000/scenery/rubycode.
For part B, from step 1 to 4, we are creating a application "scenery", step 2 instructs to create a controller "demo", step 3 instructs to create a method "rubycode" of "demo", therefore, I can open http://localhost:3000/demo/rubycode only. I have checked route.rb, there is mapping statement shows that 1st segment should be a controller. map.connect ':controller/:action/:id'
Is there anyone can teach me how to do to archieve the result?
I felt same, they might be typing errors. But one day I found we could do it by modifying route.rb file. Then just tried, it worked fine. Therefore, I would like to share my findings here.
I've got problem on open URL http://localhost:3000/scenery/rubycode.
ReplyDeleteFor part B, from step 1 to 4, we are creating a application "scenery", step 2 instructs to create a controller "demo", step 3 instructs to create a method "rubycode" of "demo", therefore, I can open http://localhost:3000/demo/rubycode only.
I have checked route.rb, there is mapping statement shows that 1st segment should be a controller.
map.connect ':controller/:action/:id'
Is there anyone can teach me how to do to archieve the result?
I found the solution. Just change setting in config/route.rb file.
ReplyDeleteAdd below lines in the file.
map.connect "scenery/:action",
:controller => "demo"
In addion, we can do same in Part C (red team).
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI have the same problem in Part B & C. I think they are typing error. They must be:
ReplyDeletehttp://localhost:3000/demo/rubycode
http://localhost:3000/cabs/cabtype
I felt same, they might be typing errors. But one day I found we could do it by modifying route.rb file. Then just tried, it worked fine. Therefore, I would like to share my findings here.
ReplyDelete:-)
Oh! I am the late comer, I got the same problem, too! Thank you for both of your share.
ReplyDelete