on_the_spot 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ Inside your `routes.rb` you need to provide the following route:
16
16
 
17
17
  resources :posts do
18
18
  collection do
19
- post :update_attribute_on_the_spot
19
+ put :update_attribute_on_the_spot
20
20
  end
21
21
  end
22
22
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -8,6 +8,7 @@ $(document).ready(function() {
8
8
  });
9
9
  $('.on_the_spot_editing').each(function(n){
10
10
  var el = $(this),
11
+ auth_token = el.attr('data-auth'),
11
12
  data_url = el.attr('data-url'),
12
13
  ok_text = el.attr('data-ok') || 'OK',
13
14
  cancel_text = el.attr('data-cancel') || 'Cancel',
@@ -27,6 +28,10 @@ $(document).ready(function() {
27
28
  original.reset();
28
29
  //just show the error-msg for now
29
30
  alert(xhr.responseText);
31
+ },
32
+ submitdata: {
33
+ authenticity_token: auth_token,
34
+ _method: 'put'
30
35
  }
31
36
  };
32
37
  if (edit_type != null) {
@@ -49,4 +54,4 @@ $(document).ready(function() {
49
54
  el.editable(data_url, options)
50
55
  })
51
56
 
52
- });
57
+ });
@@ -62,6 +62,7 @@ module OnTheSpot
62
62
  html_options[:'data-ok'] = options[:ok_text]
63
63
  html_options[:'data-cancel'] = options[:cancel_text]
64
64
  html_options[:'data-tooltip'] = options[:tooltip]
65
+ html_options[:'data-auth'] = form_authenticity_token if defined? form_authenticity_token
65
66
 
66
67
  content_tag("span", html_options) do
67
68
  if options[:display_text]
@@ -88,4 +89,4 @@ module OnTheSpot
88
89
  end
89
90
 
90
91
  end
91
- end
92
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{on_the_spot}
8
- s.version = "0.0.8"
8
+ s.version = "0.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Van der Auwera"]
12
- s.date = %q{2011-04-25}
12
+ s.date = %q{2011-05-04}
13
13
  s.description = %q{Unobtrusive in place editing, using jEditable; only works in Rails 3}
14
14
  s.email = %q{nathan@dixis.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 8
9
- version: 0.0.8
8
+ - 9
9
+ version: 0.0.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nathan Van der Auwera
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-04-25 00:00:00 +02:00
17
+ date: 2011-05-04 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency