Skip to content

Instantly share code, notes, and snippets.

<%= 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 %>
<form accept-charset="UTF-8" action="/videos/485" class="simple_form video" data-remote="true" id="edit_video_485" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓">
<input name="_method" type="hidden" value="put">
<input name="authenticity_token" type="hidden" value="JP2BqwAxrsYw7pjQi6Ge7h4WXIdUqGfr8a42fI9Ezts=">
</div>
<div class="input string optional">
<input class="string optional" id="video_comment_title_names" name="video[comment_title_names]" placeholder="Add a Comments Title" size="50" type="text" value="vsdvd">
</div>
<input class="button" id="add_comment_title" name="commit" type="submit" value="Add">
<div id='main_profile_column'>
<div id="video_div">
<% @profile.user.videos.each do |video| %>
<%= render 'videos/video', :video => video %>
<% end %>
</div>
<%= paginate @videos %>
</div>
@videos = @profile.user.videos.page(params[:page]).per(4)
Uncaught TypeError: Cannot set property '_renderItem' of undefined
d.d.extend._Deferred.f.resolveWithjquery-1.5.1.min.js:16
d.d.extend.readyjquery-1.5.1.min.js:16
d.c.addEventListener.A
.data( "autocomplete" )._renderItem = function( ul, item ) {
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + item.topic.name + "</a>" )
.appendTo( ul );
};
$(".topic_field").autocomplete({
minLength: 1,
source: '/topics.json',
focus: function(event, ui) {
$('.topic_field').val(ui.item.topic.name);
return false;
},
select: function(event, ui) {
var url = $('.edit_video').attr('action');
var val = ui.item.topic.name;
@meltzerj
meltzerj / show.js.erb
Created April 8, 2011 06:22
profile show view
<div id='main_profile_column'>
<div id="video_div">
<% @videos.each do |video| %>
<%= render 'videos/video', :video => video %>
<% end %>
</div>
<%= paginate @videos %>
</div>
<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>
fires :video_added, :on => :create,
:actor => :user