In rails4, the notation of routes.rb has been changed:
Rails3:
SampleApp::Application.routes.draw do root to: 'static_pages#home' match '/help', to: 'static_pages#help', via: 'get' match '/about', to: 'static_pages#about', via: 'get' match '/contact', to: 'static_pages#contact', via: 'get' . . . end
Rails4:
SampleApp::Application.routes.draw do
root to: 'static_pages#home'
get 'help' => "static_pages", as: 'help'
get 'about' => "static_pages", as: 'about'
get 'contact' => "static_pages", as: 'contact'
Enjoy!
0 件のコメント:
コメントを投稿