NoMethodError in Posts#showitem

Showing /home/u/u2236641/rails/kulturarv/app/views/posts/showitem.html.erb where line #2 raised:

undefined method `collectiontype_id' for nil:NilClass

Extracted source (around line #2):

1: <% @post = @showpost %>
2: <% if @showpost.collection.collectiontype_id == Collectiontype::IMAGE %>
3: <%= render :partial => "show_image_form" %>
4: <% elsif @showpost.collection.collectiontype_id == Collectiontype::SOUND %>
5: <%= render :partial => "show_sound_form" %>

Rails.root: /home/u/u2236641/rails/kulturarv

Application Trace | Framework Trace | Full Trace
app/views/posts/showitem.html.erb:2:in `_app_views_posts_showitem_html_erb___942799987_102618950'

Request

Parameters:

{"id"=>"800"}

Show session dump

Show env dump

Response

Headers:

None