hallo_rails 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module HalloRails
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/hallo_rails.rb CHANGED
@@ -20,7 +20,7 @@ module HalloRails
20
20
  object_name = object.class.to_s.underscore
21
21
  options.reverse_merge! tag: :div,
22
22
  content: object.send(method).try(:html_safe),
23
- update_url: "#{object_name.pluralize}/#{object.to_param}",
23
+ update_url: "/#{object_name.pluralize}/#{object.to_param}",
24
24
  blank_text: "<i>Click to Edit</i>".html_safe
25
25
 
26
26
  content_tag options[:tag], options[:content].present? ? options[:content] : options[:blank_text],
@@ -19,32 +19,32 @@ init = ->
19
19
  $.extend options, { plugins: plugins }
20
20
  $el.hallo options
21
21
 
22
- $('body').on "hallodeactivated", '.editable', ->
23
- $el = $(this)
24
-
25
- data = {}
26
- method_data = {}
27
- method_data[$el.data('method')] = $el.html()
28
- data[ $el.data('model') ] = method_data
29
- for property_name of $el.data()
30
- if typeof $el.data(property_name) == 'string' and property_name != 'method' and
31
- property_name != 'model' and property_name != 'updateUrl'
32
- data[property_name] = $el.data(property_name)
33
-
34
- $.ajax
35
- url: $el.data('update-url')
36
- type: 'PUT'
37
- data: data
38
- beforeSend: ->
39
- $el.addClass('hallo_updating')
40
- success: ->
41
- $el.removeClass('hallo_updating')
42
-
43
- $('body').on "hallodeactivated", '.form_editable', ->
44
- $el = $(this)
45
- hidden_textarea_name = "#{$el.data('model')}[#{$el.data('method')}]"
46
- $hidden_textarea = $el.next("textarea[name='#{hidden_textarea_name}']")
47
- $hidden_textarea.html $el.html()
22
+ $('body').on "hallodeactivated", '.editable', ->
23
+ $el = $(this)
24
+
25
+ data = {}
26
+ method_data = {}
27
+ method_data[$el.data('method')] = $el.html()
28
+ data[ $el.data('model') ] = method_data
29
+ for property_name of $el.data()
30
+ if typeof $el.data(property_name) == 'string' and property_name != 'method' and
31
+ property_name != 'model' and property_name != 'updateUrl'
32
+ data[property_name] = $el.data(property_name)
33
+
34
+ $.ajax
35
+ url: $el.data('update-url')
36
+ type: 'PUT'
37
+ data: data
38
+ beforeSend: ->
39
+ $el.addClass('hallo_updating')
40
+ success: ->
41
+ $el.removeClass('hallo_updating')
42
+
43
+ $('body').on "hallodeactivated", '.form_editable', ->
44
+ $el = $(this)
45
+ hidden_textarea_name = "#{$el.data('model')}[#{$el.data('method')}]"
46
+ $hidden_textarea = $el.next("textarea[name='#{hidden_textarea_name}']")
47
+ $hidden_textarea.html $el.html()
48
48
 
49
49
  @HalloRails = { default_options, default_plugins, init }
50
50
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hallo_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -59,7 +59,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
59
  version: '0'
60
60
  segments:
61
61
  - 0
62
- hash: 4399511932397100775
62
+ hash: -584789263880855248
63
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  segments:
70
70
  - 0
71
- hash: 4399511932397100775
71
+ hash: -584789263880855248
72
72
  requirements: []
73
73
  rubyforge_project:
74
74
  rubygems_version: 1.8.24