Here is the relevant part of the micropost view. .
<li>
<span class="content"><%= micropost.content %></span>
<span class="product"><%= micropost.product %></span>
<span class="price"><%= micropost.price %></span>
<span class="location"><%= micropost.location %></span>
<span class="timestamp">
Posted <%= time_ago_in_words(micropost.created_at) %> ago.
</span>
<% if current_user?(micropost.user) %>
<%= link_to "delete", micropost, method: :delete,
confirm: "You sure?",
title: micropost.content %>
<% end %>
I recently added product, price, and location to the columns in the micropost table. I checked in the database and these aspects are being recorded/written but for some reason content is the only one that gets displayed on the app. Why are the other ones left out?
Here is the generated HTML. Im assuming that this is the relevant section. as you can see the html for product, price and location is never generated.
<li id="1">
<a href="/users/1"><img alt="alex" class="gravatar" src="http://gravatar.com/avatar/a6759dcef8e5aad4e77509e5479b9823.png?s=50" /></a>
<span class="user">
<a href="/users/1">alex</a>
</span>
<span class="content">first</span>
<span class="timestamp">
Posted less than a minute ago.
</span>
<a href="/microposts/1" data-confirm="You sure?" data-method="delete" rel="nofollow" title="first">delete</a>
</li>
I dont think its the difference between attr_accessor and attr_accessible because content is attr_accessor and it shows up. also, I read the difference and it doesnt seem to be relevant here. I believe attr_accessible is the right one. plus I tried changing it to attr_accessor and it didnt work. Any other ideas? please and thank you!