Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow date_select and datetime_select to have NULL values so we don't…

… automatically update to current date on save.
  • Loading branch information...
commit 4e6d9bcd48d5c5d1810593e58e0d2c5722f08a31 1 parent e9ab72e
@ijcd ijcd authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/auto_admin_simple_theme.rb
View
11 lib/auto_admin_simple_theme.rb
@@ -64,13 +64,12 @@ def wrap_field(field_type, field_name, options, &block)
#def self.append_features base
# # I don't think I actually need this cleverness...
# instance_methods(false).each do |meth|
- # base.class_eval <<-end_src, __FILE__, __LINE__
- # alias :shadow_#{meth} :#{meth}
- # end_src
+ # base.class_eval "alias :shadow_#{meth} :#{meth}", __FILE__, __LINE__
# end
# super
#end
end
+
def self.TableBuilder(form_builder)
klass = Class.new(form_builder)
klass.send :include, TableBuilder
@@ -251,12 +250,14 @@ def hidden_field(field, options = {})
super
end
def date_select(field, options = {})
+ options[:include_blank] = true
common_option_translations! options
- super
+ super(field, options)
end
def datetime_select(field, options = {})
+ options[:include_blank] = true
common_option_translations! options
- super
+ super(field, options)
end
def text_field_with_auto_complete(field, options = {})
common_option_translations! options
Please sign in to comment.
Something went wrong with that request. Please try again.