1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Clean the code a bit

This commit is contained in:
Santiago Pastorino 2013-06-29 21:20:08 -07:00
parent 08f8c8aa52
commit 4eedb3928e
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@ module ActionView
class ColorField < TextField # :nodoc:
def render
options = @options.stringify_keys
options["value"] = options.fetch("value") { validate_color_string(value(object)) }
options["value"] ||= validate_color_string(value(object))
@options = options
super
end

View file

@ -4,7 +4,7 @@ module ActionView
class DatetimeField < TextField # :nodoc:
def render
options = @options.stringify_keys
options["value"] = options.fetch("value") { format_date(value(object)) }
options["value"] ||= format_date(value(object))
options["min"] = format_date(options["min"])
options["max"] = format_date(options["max"])
@options = options