README.md in bootstrap-editable-rails-0.0.3 vs README.md in bootstrap-editable-rails-0.0.4

- old
+ new

@@ -1,10 +1,10 @@ # Bootstrap Editable Rails In-place editing with Twitter Bootstrap for Rails -This gem is based on X-editable (v1.3.0) which is the new version of Bootstrap Editable. +This gem is based on X-editable (v1.4.1) which is the new version of Bootstrap Editable. https://github.com/vitalets/x-editable ## Demo & Documents @@ -33,19 +33,17 @@ //= require bootstrap-editable //= require bootstrap-editable-rails //= require_tree . ``` -(You can choose `bootstrap-editable-inline`) - and need to load `bootstrap-editable.css` at the place where you like. ### HTML -Follow the documents above. +Follow the documents of X-editable above. -Additional required attribute(option) is `resource`. +Additional required attribute is `resource`. ```html <a href="#" id="username" data-type="text" data-resource="post" data-name="username" data-url="/posts/1" data-original-title="Enter username">superuser</a> ``` @@ -53,20 +51,28 @@ ``` post[username]=superuser ``` +When using `textarea` type, `textarea_format` helper method for formatting line breaks is available. + +```html +<a href="#" id="body" data-type="textarea" data-resource="post" data-name="body" data-url="/posts/1" data-original-title="Enter body"> + <%= textarea_format(@post.body) %> +</a> +``` + ### Controller PostsController receives the parameters ``` { "id" => "1", "post" => { "username" => "superuser" } } ``` and must respond with 2xx (means _success_) status code if successful. -For example, scaffold goes well because default dataType is json. +For example, scaffold works well by 204 because default dataType is json. ```ruby def update @post = Post.find(params[:id])