diff options
author | miloops <miloops@gmail.com> | 2008-07-01 11:08:25 -0300 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-07-04 01:06:22 +0100 |
commit | 570f5aad663fa3113772cf56306862829babc739 (patch) | |
tree | fd97d993462725d336500c094450866e1bfb6761 /actionpack/lib/action_view | |
parent | 1a478923dc909bf7b6aea4f2ad49cbeee6dea259 (diff) | |
download | rails-570f5aad663fa3113772cf56306862829babc739.tar.gz rails-570f5aad663fa3113772cf56306862829babc739.tar.bz2 rails-570f5aad663fa3113772cf56306862829babc739.zip |
Allow date helpers to ignore date hidden field tags. [#503 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/lib/action_view')
-rwxr-xr-x | actionpack/lib/action_view/helpers/date_helper.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 50ae27da61..d018034ebe 100755 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -159,7 +159,10 @@ module ActionView # Returns a set of select tags (one for hour, minute and optionally second) pre-selected for accessing a specified # time-based attribute (identified by +method+) on an object assigned to the template (identified by +object+). # You can include the seconds with <tt>:include_seconds</tt>. - # + # + # This method will also generate 3 input hidden tags, for the actual year, month and day unless the option + # <tt>:ignore_date</tt> is set to +true+. + # # If anything is passed in the html_options hash it will be applied to every select tag in the set. # # ==== Examples @@ -655,7 +658,7 @@ module ActionView order.reverse.each do |param| # Send hidden fields for discarded elements once output has started # This ensures AR can reconstruct valid dates using ParseDate - next if discard[param] && date_or_time_select.empty? + next if discard[param] && (date_or_time_select.empty? || options[:ignore_date]) date_or_time_select.insert(0, self.send("select_#{param}", datetime, options_with_prefix(position[param], options.merge(:use_hidden => discard[param])), html_options)) date_or_time_select.insert(0, |