README.md in x-editable-rails-1.5.0 vs README.md in x-editable-rails-1.5.1

- old
+ new

@@ -82,16 +82,20 @@ ```ruby # the editable object and the attribute to edit %h1= editable @model, :name ``` -The helper method automatically adds these `data-*` attributes used by [x-editable](http://vitalets.github.io/x-editable/docs.html). +You can customize the tag name and title attribute: +* **tag** - `span` by default. +* **title** - The model and attribute name are used to create a capitalized title + +The `editable` helper method automatically adds these `data-*` attributes used by [x-editable](http://vitalets.github.io/x-editable/docs.html). + * **url** - Uses the `polymorphic_path(model)` helper method. * **source** - Only populated if the value is a boolean to convert `true` or `false` to "Yes" and "No". * **value** - Uses `model.name`. If `model.name` were a boolean value or if a `source` is specified, the `source` text would be displayed rather than the raw value. (Presumably the value is an ID and the source would have the text associated with that value.) -* **title** - The model and attribute name are used to create a capitalized title * **placeholder** - Uses the `title` value by default ```ruby # editable object, what_you_want_update, e: exception - when is xeditable? false or can? :edit, object is false %h1= editable @model, :name, url: model_path, value: @model.name.upcase @@ -155,11 +159,11 @@ This example uses the `MailingList` class and its attributes. The attribute value can be a string, which is used as the `title` and `placeholder`. If you want to specify other options, create a hash of options. -Save your YAML file in: `config/x-editable.yml`. Here is an example [example](config/x-editable.yml). +Install configuration file like this: `rails g x_editable_rails:install`, this step is not necessary ```yaml class_options: MailingList: # Specify placeholder text for each attribute or a Hash of options @@ -188,9 +192,21 @@ ```ruby model = MailingList.new editable model, :name # type: "text", title: "Mailing list name" editable model, :enabled # type: "select", title: "Enabled", source: [ "Active", "Disabled" ] +``` + +### Examples + +Gem also contains demo application with integrated x-editable + +``` +cd test/dummy +rake db:migrate +rake db:seed +rails g x_editable_rails:install # optional, it generate config example +rails s ``` ## Contributing 1. Fork it