I followed a RoR guide at
.
At 6.2(Adding a link) ,i got a error.I Open app/views/home/
index.html.erb and modify it as follows:
Hello, Rails!
<%= link_to "My Blog", posts_path %> Now started server ,and when i click on "My blog",it gave following errorNameError in Posts#index
Showing /home/amrit/blog/app/views/posts/index.html.erb where line #28
raised:
undefined local variable or method `new_posts_path’ for #<#<Class:
0xb67c1918>:0xb67c09f0>
The contents of app/view/posts/index.html.erb file are as follow
Listing posts
<% @posts.each do |post| %>
<% end %>Name | Title | Content | |||
---|---|---|---|---|---|
<%= post.name %> | <%= post.title %> | <%= post.content %> | <%= link_to 'Show', post %> | <%= link_to 'Edit', edit_post_path(post) %> | <%= link_to 'Destroy', post, :confirm => 'Are you sure?', :method => :delete %> |
<%= link_to ‘New posts’, new_posts_path%>
I am using ubuntu 10.04 and rails 3.07.
Thanks