restful_authenticationを使っているアプリケーションで、AdminモジュールのUsersコントローラをgeneratorで作成しようとしたら、以下のようにエラーになった。
$ ./script/generate controller admin/users The name 'Admin::UsersHelper' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again.
'Admin::UsersHelper'はないので、原因が分からない。
restful_authenticationを使っていないアプリケーションで同じことをしたら、大丈夫だった。
次に'Admin::Test'コントローラを作成したら、大丈夫だった。
$ ./script/generate controller admin/test
create app/controllers/admin
create app/helpers/admin
create app/views/admin/test
create test/functional/admin
create app/controllers/admin/test_controller.rb
create test/functional/admin/test_controller_test.rb
create app/helpers/admin/test_helper.rb
'Admin::Test'コントローラを作成してから、'Admin::Users'を作成したら、なぜか大丈夫だった。
$ ./script/generate controller admin/users
exists app/controllers/admin
exists app/helpers/admin
create app/views/admin/users
exists test/functional/admin
create app/controllers/admin/users_controller.rb
create test/functional/admin/users_controller_test.rb
create app/helpers/admin/users_helper.rb
'Admin::Test'はいらないので削除。
$ ./script/destroy controller admin/test
rm app/helpers/admin/test_helper.rb
rm test/functional/admin/test_controller_test.rb
rm app/controllers/admin/test_controller.rb
notempty test/functional/admin
notempty test/functional
notempty test
rmdir app/views/admin/test
notempty app/views/admin
notempty app/views
notempty app
notempty app/helpers/admin
notempty app/helpers
notempty app
notempty app/controllers/admin
notempty app/controllers
notempty app
よく分からないけど、とりあえずこれでOKだったので、メモしておく。
railsのバグですね。2.2.0では直っているみたいです。
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/545
willnetさん
情報ありがとうございました。