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:
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.
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.
Any ideas or suggestions?
Thanks in advance