script/generate namespaced controllers

110 views
Skip to first unread message

Claudio Poli

unread,
Jul 22, 2008, 7:26:18 AM7/22/08
to Ruby on Rails: Talk
does this happen to anyone else? edge rails.

kain-osx:careme kain$ script/generate controller api/documents index
show
create app/controllers/api
create app/helpers/api
create app/views/api/documents
create test/functional/api
create app/controllers/api/documents_controller.rb
create test/functional/api/documents_controller_test.rb
create app/helpers/api/documents_helper.rb
create app/views/api/documents/index.html.erb
create app/views/api/documents/show.html.erb
kain-osx:careme kain$ script/generate controller api/diagnoses index
show
The name 'api' is either already used in your application or
reserved by Ruby on Rails.
Please choose an alternative and run this generator again.

Suggestions:

Apus
genus Apus

on the first try things works, the second time you generate a
controller via the same namespace throws this error, tried with
different words, same result.

Thorsten Müller

unread,
Jul 22, 2008, 7:32:37 AM7/22/08
to Ruby on Rails: Talk
I'm not sure, if there are several alternative
syntax variants for this, but we use:

script/generate controller app:documents

colon instead of slash here

Claudio Poli

unread,
Jul 22, 2008, 7:36:31 AM7/22/08
to rubyonra...@googlegroups.com
hi,
I've already tried:

kain-osx:careme kain$ script/generate controller api:diagnoses index
show
wrong constant name Api:diagnosesController

kain-osx:careme kain$ script/generate controller api:Diagnoses index
show
wrong constant name Api:DiagnosesController

kain-osx:careme kain$ script/generate controller api::diagnoses index
show
The name 'api' is either already used in your application or
reserved by Ruby on Rails.
Please choose an alternative and run this generator again.

Suggestions:

Apus
genus Apus


Il giorno 22/lug/08, alle ore 13:32, Thorsten Müller ha scritto:

Thorsten Müller

unread,
Jul 22, 2008, 7:51:37 AM7/22/08
to Ruby on Rails: Talk
>    The name 'api' is either already used in your application or  
> reserved by Ruby on Rails.

maybe api is a keyword and can't be used?
Did you try another one?

Claudio Poli

unread,
Jul 22, 2008, 7:55:35 AM7/22/08
to rubyonra...@googlegroups.com
I think this is related to this:

http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/138-script-generate-glitch-for-controllers-in-modules

Il giorno 22/lug/08, alle ore 13:51, Thorsten Müller ha scritto:
Reply all
Reply to author
Forward
0 new messages