Forum: Ruby on Rails How to set scaffold inmulti directory controller in rails2.x

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.
Near C. (Guest)
on 2008-12-19 07:30
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
Bosko I. (Guest)
on 2008-12-19 09:32
(Received via mailing list)
You should use:

ruby script/generate scaffold admin::Sale



On Dec 19, 6:30 am, Near C. <removed_email_address@domain.invalid>
Near C. (Guest)
on 2008-12-19 10:02
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>
Sijo k. (Guest)
on 2008-12-19 11:42
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
Near C. (Guest)
on 2008-12-21 08:18
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
This topic is locked and can not be replied to.