route use to url_for, link_to, and redirect_to
http://manuals.rubyonrails.com/read/chapter/65
ActionController::Routing.draw do |map|
map.connect ':controller/:action/:id'
end
BlogController#index
ActionController::Routing.draw do |map|
map.connect ':controller/:action/:id', :controller => 'blog'
# url_for :controller => ‘blog’, :action => ‘index’
end
http://manuals.rubyonrails.com/read/chapter/65
ActionController::Routing.draw do |map|
map.connect ':controller/:action/:id'
end
BlogController#index
ActionController::Routing.draw do |map|map.connect ':controller/:action/:id', :controller => 'blog'
# url_for :controller => ‘blog’, :action => ‘index’
end
BlogController#recent
ActionController::Routing.draw do |map|
map.connect '', :controller => 'blog', :action => 'recent'
# url_for :controller => ‘blog’, :action => ‘recent’ will create an empty path
map.connect ':controller/:action/:id'
end
ความคิดเห็น