Scaffolding issue - new action defaults to list action


#1

I’m creating a photo blog with ror. The front end has gone great, so
now I’m working on the back end, and was playing with scaffolding.

I generated these scaffolds:
ruby script/generate scaffold Photo admin/photo
ruby script/generate scaffold Camera admin/camera

Then, in my routes, I added this line:
map.connect ‘/admin’, :controller=>“admin/photo”, :action=> “get_info”

The scaffolds work fine for everything with the exception of creating a
new photo or new camera. I can edit, destory, show and list. However,
when I hit the new button the url changes correctly:

http://localhost:3000/admin/photo
changes to
http://localhost:3000/admin/photo/new

However, the page is displaying as if it were at the list controller. I
haven’t touched the controller.

If I make the url this:
http://localhost:3000/admin/photo/new/1

Then I get the form for a new photo. However, when I try hit submit to
create one, the page goes back to the list view, however, a new photo
was not created.

Any ideas?

My routes file is as follows:

map.connect ‘’, :controller => “photo”, :action=> “index”
map.connect ‘:controller/’, :action=> “index”
map.connect ‘:controller/:photo’, :action=> “index”
map.connect ‘:controller/:photo/addcomment’, :action=> “addcomment”
map.connect ‘/admin’, :controller=>“admin/photo”, :action=> “index”

Allow downloading Web Service WSDL as a file with an extension

instead of a file named ‘wsdl’

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

Install the default route as the lowest priority.

map.connect ‘:controller/:action/:id’

Any ideas or suggestions?

Thanks in advance
-tyler