Skip to content

Instantly share code, notes, and snippets.

Uncaught SyntaxError: Unexpected identifier
d.d.extend.globalEval
d.ajaxSetup.converters.text script
bQj
v
d.support.ajax.d.ajaxTransport.send.c
$("#video_485").parent().parent().children(".topic_holder").html('<div class ="topic" id ="topicable_267"><a href="#" class="topic_link">hard rap</a><a href="/topicables/267" class="topic_delete" data-method="delete" data-remote="true" rel="nofollow">x</a></div><div class ="topic" id ="topicable_268"><a href="#" class="topic_link">eedefva</a><a href="/topicables/268" class="topic_delete" data-method="delete" data-remote="true" rel="nofollow">x</a></div><div class ="topic" id ="topicable_269"><a href="#" class="topic_link">sassaas</a><a href="/topicables/269" class="topic_delete" data-method="delete" data-remote="true" rel="nofollow">x</a></div><div class ="topic" id ="topicable_270"><a href="#" class="topic_link">adsdsasd</a><a href="/topicables/270" class="topic_delete" data-method="delete" data-remote="true" rel="nofollow">x</a></div>');
$(".edit_video")[0].reset();
$("#edit_topics_link").text(Edit Topics);
$("#edit_topics_link").text("<%= (@video.topics.count == 0) ? 'Add descriptive topics so people can find your song!' : 'Edit Topics' %>");
def edit
@video = current_user.videos.find(params[:id])
end
#Link in video show view
<%= link_to "Enable Commenting", new_comment_title_path(:format => :js), :id => 'enable_commenting_link', :class => 'edit' %>
#comment_titles/new.js.erb
$("<%= escape_javscript render(:file => 'comment_titles/new.html.erb') %>").insertAfter('#enable_commenting_link');
$('#enable_commenting_link').hide();
#comment_titles/new.html.erb
#application_helper
def setup_video(video)
returning(video) do |v|
v.comment_titles.build if v.comment_titles.empty?
end
end
NoMethodError in Videos#show
Showing /rubyprograms/dreamstill/app/views/videos/show.html.erb where line #26 raised:
undefined method `new_video_comment_title_path' for #<#<Class:0x1030d0c60>:0x1030c9b68>
<a href="#" onclick="add_fields(this, &amp;quot;comment_titles&amp;quot;, &amp;quot;&amp;lt;p class=\&amp;quot;fields\&amp;quot;&amp;gt;\n&amp;lt;label for=\&amp;quot;video_comment_titles_attributes_new_comment_titles_title\&amp;quot;&amp;gt;Comment Title:&amp;lt;\/label&amp;gt; \n&amp;lt;input id=\&amp;quot;video_comment_titles_attributes_new_comment_titles_title\&amp;quot; name=\&amp;quot;video[comment_titles_attributes][new_comment_titles][title]\&amp;quot; size=\&amp;quot;30\&amp;quot; type=\&amp;quot;text\&amp;quot; /&amp;gt;\n&amp;lt;input id=\&amp;quot;video_comment_titles_attributes_new_comment_titles__destroy\&amp;quot; name=\&amp;quot;video[comment_titles_attributes][new_comment_titles][_destroy]\&amp;quot; type=\&amp;quot;hidden\&amp;quot; value=\&amp;quot;false\&amp;quot; /&amp;gt;&amp;lt;a href=\&amp;quot;#\&amp;quot; onclick=\&amp;quot;remove_fields(this); return false;\&amp;quot;&amp;gt;remove&amp;lt;\/a&amp;gt;\n&amp;lt;input id=\&amp;quot;add_comment_title\&amp;quot; name=\&amp;quot;commit\&a
link_to_function(name, h("add_fields(this, \"#{association}\", \"#{escape_javascript(fields)}\")"))
<%= simple_form_for([@video, @video.comments.new]) do |f| %>
<%= f.association :comment_title, :label => "Comment Title:", :include_blank => false %>
<%= f.input :body, :label => false, :placeholder => "Post a comment." %>
<%= f.button :submit, :value => "Post" %>
<% end %>