I followed a RoR guide at
Getting Started with RailsThis guide covers getting up and running with Ruby on Rails.After reading this guide, you will know: How to install Rails, create a new Rails application, and connect your application to a database. The general layout of a...
.
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 error
NameError 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
Hi,
Did you add a resources :posts at this routes?
2011/4/23 amrit pal pathak [email protected]
Thanks
–
Carina B. Silva
http://twitter.com/carinabs8
“…Estou disposto a demolir paredes,contruir pontes e acender
fogueiras.
Tenho uma grande experincia,um monte de energia,um pouco dessa coisa de
‘viso’ e no tenho medo de comear do zero.”-Steve Jobs
On Apr 23, 2:20am, Carina B. [email protected] wrote:
Hi,
Did you add a resources :posts at this routes?
error is solved .was syntax error.
Thanks
Oh, ok … =^^=
2011/4/23 amrit pal pathak [email protected]
You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected] .
To unsubscribe from this group, send email to
[email protected] .
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en .
–
Carina B. Silva
http://twitter.com/carinabs8
“…Estou disposto a demolir paredes,contruir pontes e acender
fogueiras.
Tenho uma grande experincia,um monte de energia,um pouco dessa coisa de
‘viso’ e no tenho medo de comear do zero.”-Steve Jobs