Skip to content

Instantly share code, notes, and snippets.

@seivan
Forked from anonymous/gist:404838
Created May 18, 2010 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seivan/404849 to your computer and use it in GitHub Desktop.
Save seivan/404849 to your computer and use it in GitHub Desktop.
// views/reviews/create.js.erb
$("#new_review").before('<div id="flash_notice"><%= escape_javascript(flash.delete(:notice)) %></div>');
$("#reviews_count").html("<%= pluralize(@review.product.reviews.count, 'Review') %>");
$("#reviews").append("<%= escape_javascript(render(:partial => @review)) %>");
$("#new_review")[0].reset();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment