
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
None | size: 0.43 KB | hits: 15 | expires: Never
Rails 3 remote link_to redirects my browser into js page instead of just executing
<%= link_to "Comment", new_blog_post_comment_path(@blog_post, format: :js),
remote: true, id: 'new_comment_link', class: 'btn' %>
$("<%= escape_javascript(render(:file => 'comments/new.html.erb')) %>")
.insertAfter('#blog_post'); // Insert the comment form before the first comment
$('#new_comment').slideDown();
$('#new_comment_link').hide();