Skip to content

Instantly share code, notes, and snippets.

ActiveRecord::Associations::PolymorphicError in Videos#index
Showing /rubyprograms/dreamstill/app/views/layouts/application.html.erb where line #15 raised:
Could not find a valid class for :profiles_showable_objects (tried ProfilesShowableObject). If it's namespaced, be sure to specify it as :"module/profiles_showable_objects" instead.
/rubyprograms/dreamstill/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/configuration.rb:7: Configuration is not a class (TypeError)
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
from /rubyprograms/dreamstill/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs.rb:23
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
from /Library/R
:collection => @video.comment_titles.map {|ct| [ct.title, { :data_url => comment_title_path(ct) }, ct.id]}
:collection => @video.comment_titles.map {|ct| [ct.title, {:value => ct.id, :data_url => comment_title_path(ct)}]}
<form accept-charset="UTF-8" action="/videos/485/comments" class="simple_form comment comment_form" data-remote="true" id="new_comment" method="post">
<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓">
<input name="authenticity_token" type="hidden" value="uN9pEFR6ITTas2Uy1VCshCgt3CHV+9W7Oml5G19mJsU=">
</div>
<div class="input select optional comment_form">
<label class="select optional" for="comment_comment_title_id"> Comment Title:</label>
<select class="select optional" id="comment_comment_title_id" name="comment[comment_title_id]">
<option value="/comment_titles/265">dfvsdfvds</option>
<option value="/comment_titles/266">fesfsees</option>
</select>
%= f.association :comment_title, :collection => @video.comment_titles.map {|ct| [ct.title, comment_title_path(ct)] }, :label => "Comment Title:", :include_blank => false %>
ActionView::Template::Error (You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.to_key):
1: $("#<%= dom_id(@comment.comment_title) %>").parent().append('<%= escape_javascript(render(@comment)) %>');
2: $(".comment_form")[0].reset();
app/views/comments/create.js.erb:1:in `_app_views_comments_create_js_erb___503385093_2173588800_0'
app/controllers/comments_controller.rb:8:in `create'
@comment_title = @video.comment_titles.last
def update
@video = current_user.videos.find(params[:id])
respond_to do |format|
if @video.update_attributes(params[:video])
format.html { redirect_to(@video) }
format.js
else
format.html { render :action => "edit" }
end
ActiveRecord::RecordNotFound (Couldn't find CommentTitle with ID=485):
app/controllers/videos_controller.rb:44:in `update'