When I fired up the rails server and tried to visit my scaffold page I got the following error: “undefined local variable or method `root_path'”. The error was in one of the layout templates where it referenced the root_path. I googled around a bit for the specific error with no luck. Then tried the search “rails4 root_path”. Seems like its no longer defined as a route by default. You have to do the following to get it to work:
- Open routes.rb
- add a route like the following
root :to => "controller#action"
Hope this helps others!