Forum: Ruby on Rails Dynamic Scaffolding vs. ScaffoldGenerator

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Rich W. (Guest)
on 2006-04-07 06:56
(Received via mailing list)
I asked this question before, but didn't get any response. I hope
someone can give me some clue now.

Here's the background, I upgraded to rails 1.1 and suddenly I was
getting strange failures in my functional tests. I traced the problem
to dynamic scaffolding. I had overwritten all of scaffold's methods
in my controller (all but show and destroy). Destroy no longer
deleted the given item, and (more importantly) the functional tests
called scaffold's version of create, rather than mine (though when
run in the server, the correct version was called).

I created a duplicate of my application, and used ScaffoldGenerator
on the duplicate. I then copied the show.rhtml and the two undefined
methods (show and destroy) into my application. After commenting out
dynamic scaffolding, everything works perfectly, no failures in the
tests, etc). So there's clearly some difference between dynamic
scaffolding and the code generated by ScaffoldGenerator.

Is this a bug in dynamic scaffold? Does anyone know anything about this?

Other difference:

When testing dynamic scaffold destroy method, I needed the following:

	assert_redirected_to :action => :list

But the ScaffoldGenerator method required the following:

	assert_redirected_to :action => "list"

-Rich-
This topic is locked and can not be replied to.