Reputation: 45
When I run the rails server it returns with an error in index_html.erb. the code ran great for a few minutes then I came across this error.
routes.rb file
[
[
Upvotes: 1
Views: 165
Reputation: 10673
Rails uses the routes.rb
file to locate the various resources of your application, so any resource you expect your users to access will have to be defined in routes.rb
. You don't have a route defined for home_about_path
.
From your code, I take it you have an about
method in your home_controller.rb
controller file. You have to have the following line in your routes.rb (add it under 'get home#index
'):
get 'home#about' => 'home/about'
Adding this line should create a home_about_path
and your link_to
method should work.
Understanding routing is incredibly important to Rails development, so you should do some reading and make sure you have a good grasp of the fundamentals before pushing too far ahead.
Upvotes: 1