Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.43 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Rails 3 remote link_to redirects my browser into js page instead of just executing
  2. <%= link_to "Comment", new_blog_post_comment_path(@blog_post, format: :js),
  3. remote: true,  id: 'new_comment_link', class: 'btn' %>
  4.        
  5. $("<%= escape_javascript(render(:file => 'comments/new.html.erb')) %>")
  6. .insertAfter('#blog_post'); // Insert the comment form before the first comment
  7. $('#new_comment').slideDown();
  8. $('#new_comment_link').hide();