hallo_rails 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/hallo_rails.rb CHANGED
@@ -25,15 +25,20 @@ module HalloRails
25
25
 
26
26
  options[:content] = sanitize(options[:content]) if options[:sanitize]
27
27
 
28
+ is_editable = !options.has_key?(:editable) || options[:editable]
29
+ content_tag_data = if is_editable
30
+ {update_url: options[:update_url],
31
+ model: object_name,
32
+ method: method.to_s,
33
+ editable_options: options[:hallo_options],
34
+ editable_plugins: options[:plugins] }.merge(options[:params] || {})
35
+ end
36
+
28
37
  content_tag( :div, class: 'editable_wrapper', style: options[:inline] ? 'display:inline-block' : nil ) do
29
38
  content_tag options[:tag], options[:content].present? ? options[:content] : options[:blank_text],
30
- class: "#{'editable' if !options.has_key?(:editable) or options[:editable]}",
39
+ class: "#{'editable' if is_editable}",
31
40
  id: "#{object_name}_#{method.to_s}",
32
- data: { update_url: options[:update_url],
33
- model: object_name,
34
- method: method.to_s,
35
- editable_options: options[:hallo_options],
36
- editable_plugins: options[:plugins] }.merge(options[:params] || {})
41
+ data: content_tag_data
37
42
  end
38
43
  end
39
44
 
@@ -1,3 +1,3 @@
1
1
  module HalloRails
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -60,7 +60,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  segments:
62
62
  - 0
63
- hash: 1084584241973192819
63
+ hash: -18270218963625160
64
64
  required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  version: '0'
70
70
  segments:
71
71
  - 0
72
- hash: 1084584241973192819
72
+ hash: -18270218963625160
73
73
  requirements: []
74
74
  rubyforge_project:
75
75
  rubygems_version: 1.8.24