i am working in Ruby on rails.. i am new to this..
i have used a line
<%= link_to "about",about_path %>
which throws me a error as,
undefined local variable or method `about_path' for #<ActionView::Base:0xb5f5baa8>
i am having the page about.html under app/views/pages/
please give some suggestions of why i am getting like this .
Your code is looking for what is called a named route. You need to define these in
config/routes.rb. In addition you will need some controller and action to handle them. See this post describing a very simple way to handle static pages by way of illustration.To get the
about_pathnamed route, then you would add this toroutes.rbThen add your about page contents to a file called
app/views/pages/about.html.erbFinally:
tells you all of the named routes defined for your application and what they do