best_in_place 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -60,7 +60,7 @@ If not defined, it will default to *Yes* and *No* options.
60
60
 
61
61
  ### Display server validation errors
62
62
 
63
- If you are using a Rails application, your controller's should respond to json and js in case of error.
63
+ If you are using a Rails application, your controller's should respond to json in case of error.
64
64
  Example:
65
65
 
66
66
  def update
@@ -69,10 +69,10 @@ Example:
69
69
  respond_to do |format|
70
70
  if @user.update_attributes(params[:user])
71
71
  format.html { redirect_to(@user, :notice => 'User was successfully updated.') }
72
+ format.json { head :ok }
72
73
  else
73
74
  format.html { render :action => "edit" }
74
- format.json { render :json => @user.errors, :status => :unprocessable_entity }
75
- format.js { render :js => @user.errors, :status => :unprocessable_entity }
75
+ format.json { render :json => @user.errors.full_messages, :status => :unprocessable_entity }
76
76
  end
77
77
  end
78
78
  end
@@ -130,9 +130,16 @@ In order to use the Rails 3 gem, just add the following line to the gemfile:
130
130
  - Client Side Validation definitions
131
131
  - To accept given click handlers
132
132
  - To accept a handler to activate all best_in_place fields at once
133
+ - Specs
133
134
 
134
135
  ---
135
136
 
137
+ ##Changelog
138
+
139
+ - v.0.1.0 Initial deploy
140
+ - v.0.1.2 Fixing errors in collections (taken value[0] instead of index) and fixing test_app controller responses
141
+ - v.0.1.3 Bug in Rails Helper. Key wrongly considered an Integer.
142
+
136
143
  ##Authors, License and Stuff
137
144
 
138
145
  Code 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).
data/lib/best_in_place.rb CHANGED
@@ -4,7 +4,7 @@ module BestInPlace
4
4
  field = field.to_s
5
5
  value = object.send(field).blank? ? "-" : object.send(field)
6
6
  if formType == :select && !selectValues.blank?
7
- value = Hash[selectValues][object.send(field).to_i]
7
+ value = Hash[selectValues][object.send(field)]
8
8
  selectValues = selectValues.to_json
9
9
  end
10
10
  if formType == :checkbox
@@ -1,3 +1,3 @@
1
1
  module BestInPlace
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: best_in_place
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bernat Farrero
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-18 00:00:00 +01:00
18
+ date: 2011-01-20 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency