Forum: Ruby on Rails scaffolding issue - new action defaults to list action

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
tyler (Guest)
on 2006-04-16 08:52
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:

changes to

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:

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
This topic is locked and can not be replied to.