Skip to content

Instantly share code, notes, and snippets.

@meltzerj
Created April 8, 2011 06:42
Show Gist options
  • Select an option

  • Save meltzerj/909409 to your computer and use it in GitHub Desktop.

Select an option

Save meltzerj/909409 to your computer and use it in GitHub Desktop.
<h1>
NoMethodError in
Profiles#show
</h1>
<p>
Showing <i>/rubyprograms/dreamstill/app/views/videos/_video.html.erb</i> where line <b>#1</b> raised:
<pre><code>undefined method `model_name' for NilClass:Class</code></pre>
</p>
<p>Extracted source (around line <b>#1</b>):
<pre><code>1: &lt;%= div_for video do %&gt;
2: &lt;div class='voting_div'&gt;
3: &lt;%= link_to &quot;&amp;uArr;&quot;.html_safe, video_votes_path( :video_id =&gt; video.id, :type =&gt; &quot;up&quot; ), :method =&gt; :post, :remote =&gt; true, :class =&gt; &quot;up_arrow round #{current_user &amp;&amp; (vote = current_user.votes_for(video)) &amp;&amp; vote.value == 1 ? 'voted' : 'unvoted' }&quot; %&gt;
4: &lt;div id='vote_display' class = 'round'&gt;
</code></pre></p>
<p>Trace of template inclusion: app/views/profiles/show.js.erb</p>
<p><code>Rails.root: /rubyprograms/dreamstill</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>app/views/videos/_video.html.erb:1:in `_app_views_videos__video_html_erb___358525845_2172354840_1885950'
app/views/profiles/show.js.erb:1:in `_app_views_profiles_show_js_erb__196650825_2172365220_0'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>activemodel (3.0.4) lib/active_model/naming.rb:94:in `model_name_from_record_or_class'
activemodel (3.0.4) lib/active_model/naming.rb:81:in `singular'
actionpack (3.0.4) lib/action_controller/record_identifier.rb:49:in `dom_class'
actionpack (3.0.4) lib/action_view/helpers/record_tag_helper.rb:58:in `content_tag_for'
actionpack (3.0.4) lib/action_view/helpers/record_tag_helper.rb:21:in `div_for'
actionpack (3.0.4) lib/action_view/template.rb:135:in `send'
actionpack (3.0.4) lib/action_view/template.rb:135:in `render'
activesupport (3.0.4) lib/active_support/notifications.rb:54:in `instrument'
actionpack (3.0.4) lib/action_view/template.rb:127:in `render'
actionpack (3.0.4) lib/action_view/render/partials.rb:333:in `render_partial'
actionpack (3.0.4) lib/action_view/render/partials.rb:262:in `render'
activesupport (3.0.4) lib/active_support/notifications.rb:52:in `instrument'
activesupport (3.0.4) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.4) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.4) lib/action_view/render/partials.rb:260:in `render'
actionpack (3.0.4) lib/action_view/render/partials.rb:378:in `_render_partial'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment