在這一段代碼:哪裏`signup`,`login`,`register`方法來自
ActionController::Routing::Routes.draw do |map|
map.resources :line_items
map.resources :orders
map.resources :products
map.resources :categories
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
map.login '/login', :controller => 'sessions', :action => 'new'
map.register '/register', :controller => 'user', :action => 'create'
map.signup '/signup', :controller => 'user', :action => 'new'
map.connect '/add-to-cart', :controller => 'line_items', :action => 'new'
end
map
對象具有方法connect
和resources
調用,它在ActionController documentation中描述。其他的定義/描述在哪裏?它們是由RESTful認證插件生成的。
我應該如何將/add-to-cart
映射到其動作/控制器,以便自動生成add_to_cart_path
方法?