1
目前我正在研究RoR中的博客引擎,并遇到与路由有关的severa问题。 的routes.rb
看起来是这样的:重写Rails路线
match '/admin', :to => 'posts#new'
match '/get/:id', :to => 'posts#get'
match '/new', :to => 'posts#new'
delete '/:id', :to => 'posts#destroy'
post '/edit/:id', :to => 'posts#update'
put '/edit/:id', :to => 'posts#update'
get '/edit/:id', :to => 'posts#new', :as => 'post'
get '/:slug', :to => 'posts#show', :as => 'post'
root :to => 'posts#index'
,我想改造它是这样的:
resources :admin do
resources :posts
end
任何帮助将是非常赞赏。