To address the two responses: thank you, I took Colin's suggestion and
ran a log just trying to access a record:
2016-06-20T23:57:59.062266+00:00 app[web.1]: Completed 500 Internal
Server Error in 10ms (ActiveRecord: 3.5ms)
2016-06-20T23:57:59.061980+00:00 app[web.1]: Rendered
professors/show.html.erb within layouts/application (2.5ms)
2016-06-20T23:57:59.064210+00:00 app[web.1]: ActionView::Template::Error
(undefined method `fullname' for #<Professor:0x007fdd5ef001e8>):
2016-06-20T23:57:59.064216+00:00 app[web.1]: 20: <li>
<strong>Average Review: </strong><div class="star-rating" data-score=
<%= @avg_review %> </div></li>
2016-06-20T23:57:59.064217+00:00 app[web.1]:
2016-06-20T23:57:59.064214+00:00 app[web.1]: 18: <ul
class="list-unstyled">
2016-06-20T23:57:59.064212+00:00 app[web.1]: 15:
2016-06-20T23:57:59.064214+00:00 app[web.1]: 17: <h1
class="review_title"> <%= @professor.fullname %> </h1>
It seems to be having a problem with showing the name, I don't know why
this is a problem this page works fine on localhost. One possible thing
I can think of is that I created a column "firstname" in a recent
migration (still well before I pushed this to Heroku) could it be
possible that Postgres is using an earlier migration then SQLite?
This is my show.hm.erb where the offending method is:
<div class="col-md-6">
<h1 class="review_title"> <%= @professor.fullname %> </h1>
<ul class="list-unstyled">
<% if !@review.blank? %>
<li> <strong>Average Review: </strong><div
class="star-rating" data-score= <%= @avg_review %> </div></li>
<% end %>
<li><strong>School: </strong><%= @professor.school %></li>
<li><strong>Department: </strong> <%= @professor.department
%></li>
<li><%= "#{@review.length}" "
Review".pluralize(@review.length)%></li>
</ul>
</div>
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/230d9ef27efb341f369be408a9d060f7%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment