0

I am making a twitter like web app in rails, following a course. I am trying to change the path but every time i start the server i get an eror and the server shuts down.

this is the path:

ActionController::Routing::Routes.draw do |map|
  map.resources :posts
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end

I have done routes before but they haven't looked like that. I think this is a ruby route where as i'm on rails. I'm not too sure. I thought they would work.

4

1 回答 1

1

您的资源看起来像这样

PlatformAuth::Application.routes.draw do
  resources :posts
end

对于 map.connect 它更像是一条命名路线,它看起来像

match ':controller(/:action(/:id(.:format)))' 

这将通过获取请求使您的所有控制器操作可用。不确定这是否真的想要你想要的。

于 2012-11-22T17:34:15.973 回答