Created
January 16, 2014 15:17
-
-
Save raarellano/8456602 to your computer and use it in GitHub Desktop.
Best in place
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= best_in_place post, :post, type: :textarea, :path => post_path(post), :display_as => 'mk_statement', :sanitize => false, | |
:activator => ".edit_post_#{post.id}"%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//= require best_in_place |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'best_in_place' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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