Monday, 26 August 2013

Using routes to link to home/subpage/THIS instead of home/THIS

Using routes to link to home/subpage/THIS instead of home/THIS

I just want to link to "/resources/entrepreneurship" instead of
"/entrepreneurship". The code below doesn't seem to work because I don't
know how to link to it properly.
routes.rb
Project::Application.routes.draw do
root to: 'static_pages#home'
get '/about', to: 'static_pages#about'
get '/resources/entrepreneurship', to: 'static_pages#entrepreneurship'
end
Header
<li><%= link_to "Entrepreneurship", resources/entrepreneurship_path %></li>
The error is this when I try to open the page. "undefined local variable
or method `resources' for #<#:0x007fd46571a160>"

No comments:

Post a Comment