How to set scaffold inmulti directory controller in rails2.x


#1

Hi :
If I want to show http://localhost/admin/sales ,not
http://localhost/saqles,
I use command ruby script/generate scaffold admin/Sale,but it is failed.
How to do it please?
thanks.

cruise


#2

You should use:

ruby script/generate scaffold admin::Sale

On Dec 19, 6:30 am, Near C. removed_email_address@domain.invalid


#3

Hi :

Sorry,I have tried it and failed.

It will generate table admin_sales in database ,and nothing in
http://localhost/admin/sales/

Thanks.

Cruise

Bosko I. wrote:

You should use:

ruby script/generate scaffold admin::Sale

On Dec 19, 6:30�am, Near C. removed_email_address@domain.invalid


#4

http://localhost/admin/sales
Here you mean admin as a name space and sale as resource. Is it?
If so then do like

ruby script/generate controller admin/sale

   Now edit route.rb and add

map.namespace(:admin) do |admin|
admin.resources :sales
end

Sijo


#5

Hi :
Thank you.
I got it by following the answer.

Cruise.

Sijo Kg wrote:

http://localhost/admin/sales
Here you mean admin as a name space and sale as resource. Is it?
If so then do like

ruby script/generate controller admin/sale

   Now edit route.rb and add

map.namespace(:admin) do |admin|
admin.resources :sales
end

Sijo