inline_forms 0.9.21 → 0.9.22

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.21
1
+ 0.9.22
@@ -2,12 +2,12 @@ InlineForms::SPECIAL_COLUMN_TYPES[:date_select]=:date
2
2
 
3
3
  # date
4
4
  def date_select_show(object, attribute)
5
- link_to_inline_edit object, attribute, object.send(attribute).strftime("%m-%d-%Y")
5
+ link_to_inline_edit object, attribute, object.send(attribute).nil? ? "" : object.send(attribute).strftime("%d-%m-%Y")
6
6
  end
7
7
 
8
8
  def date_select_edit(object, attribute)
9
9
  css_id = 'datepicker_' + object.class.to_s.underscore + '_' + object.id.to_s + '_' + attribute.to_s
10
- out = text_field_tag attribute, object[attribute].strftime("%m-%d-%Y"), :id => css_id
10
+ out = text_field_tag attribute, ( object.send(attribute).nil? ? "" : object.send(attribute).strftime("%d-%m-%Y") ), :id => css_id
11
11
  out << '<SCRIPT>'.html_safe
12
12
  out << "$(function() { ".html_safe
13
13
  out << '$("#'.html_safe + css_id.html_safe + '").datepicker();'.html_safe
@@ -0,0 +1,13 @@
1
+ # not needed here, since this is only used in the views InlineForms::SPECIAL_COLUMN_TYPES[:info]=:string
2
+
3
+ def info_show(object, attribute)
4
+ object.send(attribute)
5
+ end
6
+
7
+ def info_edit(object, attribute)
8
+ object[attribute]
9
+ end
10
+
11
+ def info_update(object, attribute)
12
+ end
13
+
data/inline_forms.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{inline_forms}
8
- s.version = "0.9.21"
8
+ s.version = "0.9.22"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ace Suares"]
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
34
34
  "app/helpers/form_elements/dropdown_with_values.rb",
35
35
  "app/helpers/form_elements/geo_code_curacao.rb",
36
36
  "app/helpers/form_elements/image.rb",
37
+ "app/helpers/form_elements/info.rb",
37
38
  "app/helpers/form_elements/question_list.rb",
38
39
  "app/helpers/form_elements/scale_with_integers.rb",
39
40
  "app/helpers/form_elements/scale_with_values.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 21
10
- version: 0.9.21
9
+ - 22
10
+ version: 0.9.22
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ace Suares
@@ -135,6 +135,7 @@ files:
135
135
  - app/helpers/form_elements/dropdown_with_values.rb
136
136
  - app/helpers/form_elements/geo_code_curacao.rb
137
137
  - app/helpers/form_elements/image.rb
138
+ - app/helpers/form_elements/info.rb
138
139
  - app/helpers/form_elements/question_list.rb
139
140
  - app/helpers/form_elements/scale_with_integers.rb
140
141
  - app/helpers/form_elements/scale_with_values.rb