Permalink
Browse files

Using Yes and No (uppercased) as I18n defaults since @@label_str_meth…

…od is not :titleize anymore.

Signed-off-by: Justin French <justin@indent.com.au>
  • Loading branch information...
josevalim authored and justinfrench committed Mar 6, 2009
1 parent 374573e commit 9dfb7824d722803b9140d7a5d6ac7e1665635579
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/formtastic.rb
View
@@ -618,10 +618,9 @@ def boolean_input(method, options)
# </select>
# </li>
#
- # TODO: Doesn't handle :include_blank => true, but then again, neither do most of the inputs.
def boolean_select_input(method, options)
- options[:true] ||= I18n.t('yes', :default => 'yes', :scope => [:formtastic]).send(@@label_str_method)
- options[:false] ||= I18n.t('no', :default => 'no', :scope => [:formtastic]).send(@@label_str_method)
+ options[:true] ||= I18n.t('yes', :default => 'Yes', :scope => [:formtastic]).send(@@label_str_method)
+ options[:false] ||= I18n.t('no', :default => 'No', :scope => [:formtastic]).send(@@label_str_method)
choices = [ [options[:true],true], [options[:false],false] ]
input_label(method, options) + template.select(@object_name, method, choices, set_options(options))
@@ -653,8 +652,8 @@ def boolean_select_input(method, options)
# </fieldset>
# </li>
def boolean_radio_input(method, options)
- options[:true] ||= I18n.t('yes', :default => 'yes', :scope => [:formtastic]).send(@@label_str_method)
- options[:false] ||= I18n.t('no', :default => 'no', :scope => [:formtastic]).send(@@label_str_method)
+ options[:true] ||= I18n.t('yes', :default => 'Yes', :scope => [:formtastic]).send(@@label_str_method)
+ options[:false] ||= I18n.t('no', :default => 'No', :scope => [:formtastic]).send(@@label_str_method)
choices = { options.delete(:true) => true, options.delete(:false) => false }
radio_input(method, options.merge(:collection => choices))

0 comments on commit 9dfb782

Please sign in to comment.