Help please ASAP getting stuck on showing articles

20 views
Skip to first unread message

Aspiring.Student.programmer

unread,
Sep 29, 2014, 12:40:32 AM9/29/14
to rubyonra...@googlegroups.com

Hey

I am using the gettting started with rails tutorial on Rails guide  http://guides.rubyonrails.org/getting_started.html#showing-articles

I am up to session 5.7 Showing articles. I am stuck on this session as i have changed my parameters to be strong and all went well. I have defined my show method in my controller however, when i link this to the HTML file i put this code as seen below however when i run it it shows an error saying line 3 .title is undefined. Any advice would be great.

Thanks 

<p>
  <strong>Title:</strong>
  <%= @article.title %>
</p>
 
<p>
  <strong>Text:</strong>
  <%= @article.text %>
</p>


Colin Law

unread,
Sep 29, 2014, 2:20:40 AM9/29/14
to rubyonra...@googlegroups.com
On 29 September 2014 05:40, Aspiring.Student.programmer
Does it say that .title is undefined for nil or for an article object
or what (it is usually a good idea to copy/paste the full error
message here, others may see something significant that you had not
noticed). If it is for nil then you have not setup @article. If it
is for an article object then possibly there is no title column in the
articles table. Perhaps you forgot to run a migration.

Colin

Aspiring.Student.programmer

unread,
Sep 29, 2014, 2:54:08 AM9/29/14
to rubyonra...@googlegroups.com
Thanks but the problem was i had to place the method above the private session so it wasnt included in the private bit But thanks
Reply all
Reply to author
Forward
0 new messages