好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

change rails generate controller tempalte

change rails generate controller tempalte

X

Welcome  Googler ! If you find this page useful, you might want to  subscribe to the RSS feed  for updates on this topic.

$> mate config/routes.rb

view source print ?

1. map.namespace  :admin   do   |admin|

2. admin.resources  :user

3. end

$> rake routes

view source print ?

1. admin_user_index  GET      /admin/user

2. { :controller => 'admin/user' ,  :action => 'index' }

3. ......

$> mate config/routes.rb

view source print ?

1. map.namespace  :admin   do   |admin|

2. admin.namespace  :user   do   |user|

3. user.resources  :profile

4. end

5. end

$> rake routes

view source print ?

1. admin_user_profile_index  GET      /admin/user/profile

2. { :controller => 'admin/user/profile' ,  :action => 'index' }

3. ......

Share and Enjoy:

http://adam.heroku.com/past/2007/12/20/nested_resources_in_rails_2/

http://edgeguides.rubyonrails.org/routing.html#controller-namespaces-and-routing

http://guides.rubyonrails.org/routing.html

查看更多关于change rails generate controller tempalte的详细内容...

  阅读:45次