Skip to content

Instantly share code, notes, and snippets.

@raarellano
Created January 16, 2014 15:17
Show Gist options
  • Save raarellano/8456602 to your computer and use it in GitHub Desktop.
Save raarellano/8456602 to your computer and use it in GitHub Desktop.
Best in place
<%= best_in_place post, :post, type: :textarea, :path => post_path(post), :display_as => 'mk_statement', :sanitize => false,
:activator => ".edit_post_#{post.id}"%>
//= require best_in_place
gem 'best_in_place'
respond_to do |format|
if @post.update_attributes(params[:post])
format.html { redirect_to(@post.project, :notice => 'Post was successfully updated.') }
format.json { respond_with_bip(@post) }
else
format.html { render :action => "edit" }
format.json { respond_with_bip(@post) }
end
end
jQuery ->
$('.best_in_place').best_in_place()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment