Skip to content

Commit

Permalink
Updating README and gemspec
Browse files Browse the repository at this point in the history
  • Loading branch information
bernat committed Jan 16, 2011
1 parent 106bbff commit 9f4f801
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
27 changes: 14 additions & 13 deletions README.md
@@ -1,18 +1,20 @@
# Best In Place
## Unobtrusive in Place editing solution
**The Unobtrusive in Place editing solution**


###Description
##Description

**Best in Place** is a jQuery based AJAX Inplace-Editor that takes profit of RESTful server-side controllers to allow users to edit stuff with
no need of forms. If the server have standard defined REST methods, particularly those to UPDATE your objects (HTTP PUT), then by adding the
Javascript file to the application it is making all the fields with the proper defined classes to become user in-place editable.

The editor works by PUTting the updated value to the server and GETting the updated record afterwards to display the updated value.

[**SEE DEMO**](http://bipapp.heroku.com/)

---

###Features
##Features

- Compatible with text **inputs**
- Compatible with **textarea**
Expand All @@ -23,7 +25,7 @@ The editor works by PUTting the updated value to the server and GETting the upda

---

###Usage of Rails 3 Gem
##Usage of Rails 3 Gem

best_in_place Object, Field, [Type, [SelectValues]]

Expand All @@ -34,29 +36,29 @@ If created a [test_app](https://github.com/bernat/best_in_place/tree/master/test

Examples (code placed in the views):

#### Input
### Input

<%= best_in_place @user, :name, :input %>

#### Textarea
### Textarea

<%= best_in_place @user, :description, :textarea %>

#### Select
### Select

<%= best_in_place @user, :country, :select, [[1, "Spain"], [2, "Italy"], [3, "Germany"], [4, "France"]] %>

Of course it can take an instance or global variable for the collection, just remember the structure [[key, value], [key, value],...]

#### Checkbox
### Checkbox

<%= best_in_place @user, :receive_emails, :checkbox, ["No, thanks", "Yes, of course!"] %>

The first value is always the negative boolean value and the second the positive. If not defined, it will display *Yes* and *No* options.

---

###Installation
##Installation

It works by simply copying and loading the files from the folder **/public/javascripts** to your application and loading them in your layouts
in the following order:
Expand All @@ -76,17 +78,16 @@ In order to use the Rails 3 gem, just add the following line to the gemfile:

gem "best_in_place", :git => "http://github.com/bernat/best_in_place"

---
----

###TODO
##TODO

- Compatible with boolean checkboxes
- Client Side Validation definitions
- To accept given click handlers
- To accept a handler to activate all best_in_place fields at once

---

###Authors and License
##Authors and License

Version by [Bernat Farrero](http://bernatfarrero.com) based on the [original project](http://github.com/janv/rest_in_place/) of Jan Varwig and released under [MIT](http://www.opensource.org/licenses/mit-license.php).
4 changes: 2 additions & 2 deletions best_in_place.gemspec
Expand Up @@ -9,8 +9,8 @@ Gem::Specification.new do |s|
s.authors = ["Bernat Farrero"]
s.email = ["bernat@itnig.net"]
s.homepage = "http://github.com/bernat/best_in_place"
s.summary = %q{It allows the views to become in-place editable, it works for inputs, textareas, selects and checkbox}
s.description = %q{It allows the views to become in-place editable, it works for inputs, textareas, selects and checkbox}
s.summary = %q{It makes any field in place editable by clicking on it, it works for inputs, textareas, select dropdowns and checkboxes}
s.description = %q{It is basically a jQuery script and a Rails 3 helper that allows to use the method best_in_place to display any object that the user will be able to edit by just clicking on it. It supports input data, text data, boolean data and custom dropdown data. It works with RESTful controllers.}

s.rubyforge_project = "best_in_place"

Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/best_in_place.js
Expand Up @@ -216,7 +216,7 @@ BestInPlaceEditor.forms = {
getValue : function() {
return Boolean(this.element.html() == this.values[1])
}
},s
},

"textarea" : {
activateForm : function() {
Expand Down

0 comments on commit 9f4f801

Please sign in to comment.