<% if @project %> <%= render :partial => 'project_show', locals: {project: @project} %> <% elsif @course %> <%= render :partial => 'course_show', locals: {course: @course} %> <% elsif @contest %> <%= render :partial => 'contest_show', :locals => {:contest => @contest} %> <% elsif @organization %> <%= render :partial => 'organization_show', :locals => {:org_subfield => @org_subfield} %> <% end %>