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.
A470d209a6a3c30ad929c4907995a7d0?d=identicon&s=25 Near Cruise (nearcruise)
on 2008-12-19 06: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
9770ee3431156709c728f6105dd98f0d?d=identicon&s=25 Bosko Ivanisevic (Guest)
on 2008-12-19 08:32
(Received via mailing list)
You should use:

ruby script/generate scaffold admin::Sale



On Dec 19, 6:30 am, Near Cruise <rails-mailing-l...@andreas-s.net>
A470d209a6a3c30ad929c4907995a7d0?d=identicon&s=25 Near Cruise (nearcruise)
on 2008-12-19 09: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 Ivanisevic wrote:
> You should use:
>
> ruby script/generate scaffold admin::Sale
>
>
>
> On Dec 19, 6:30�am, Near Cruise <rails-mailing-l...@andreas-s.net>
661ae6e97d0e16c2af2aaf7d197e8387?d=identicon&s=25 Sijo k g (sijo)
on 2008-12-19 10: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
A470d209a6a3c30ad929c4907995a7d0?d=identicon&s=25 Near Cruise (nearcruise)
on 2008-12-21 07: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.