Modified GLoc helpers to ensure compatibility with rails 1.2

git-svn-id: http://redmine.rubyforge.org/svn/trunk@173 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-01-24 18:15:27 +00:00
parent 681bbf02ae
commit 66a02688ad
1 changed files with 14 additions and 1 deletions

View File

@ -115,7 +115,20 @@ module ActionView #:nodoc:
select_html(options[:field_name] || 'year', year_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled]) select_html(options[:field_name] || 'year', year_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled])
end end
# added by JP Lang
# select_html is a rails private method and changed in 1.2
# implementation added here for compatibility
def select_html(type, options, prefix = nil, include_blank = false, discard_type = false, disabled = false)
select_html = %(<select name="#{prefix || "date"})
select_html << "[#{type}]" unless discard_type
select_html << %(")
select_html << %( disabled="disabled") if disabled
select_html << %(>\n)
select_html << %(<option value=""></option>\n) if include_blank
select_html << options.to_s
select_html << "</select>\n"
end
end end
# The private method <tt>add_options</tt> is overridden so that "Please select" is localized. # The private method <tt>add_options</tt> is overridden so that "Please select" is localized.