目前,我正在开发 RoR 的博客引擎,但遇到了严重的路由问题。routes.rb
看起来像这样:
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
任何帮助将不胜感激。