ruby-on-railsruby-on-rails-4actionview

Action View Template Error


In Development it works just fine, but on Production (Heroku), it breaks with the following Error.

The Error is actually in

<%= link_to clip.user.show.name, clip.user.show %>

The Error Log:

ActionView::Template::Error (undefined method `name' for nil:NilClass):
2013-09-02T10:24:09.366120+00:00 app[web.1]:     34:
2013-09-02T10:24:09.366120+00:00 app[web.1]:     35:   <p class="clip-uploader pull-left" data-no-turbolink>
2013-09-02T10:24:09.366120+00:00 app[web.1]:     36:     <strong>
2013-09-02T10:24:09.366120+00:00 app[web.1]:     37:       <%= link_to clip.user.show.name, clip.user.show %>
2013-09-02T10:24:09.366120+00:00 app[web.1]:     38:     </strong>
2013-09-02T10:24:09.366120+00:00 app[web.1]:     39:   </p>
2013-09-02T10:24:09.366120+00:00 app[web.1]:     40:
2013-09-02T10:24:09.366120+00:00 app[web.1]:   app/views/clips/_clip.html.erb:37:in `_app_views_clips__clip_html_erb_

Why does this brake on heroku ?


Solution

  • The Solution was that i had 1 pre existing Clip in my Database from a very early version that had no show attached.