Skip to content

Commit

Permalink
partially reverted 382c552 which had a failing proc for required
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfrench committed Nov 22, 2009
1 parent b361e70 commit 7e99618
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/formtastic.rb
Expand Up @@ -8,7 +8,7 @@ class SemanticFormBuilder < ActionView::Helpers::FormBuilder
@@default_text_field_size = 50
@@all_fields_required_by_default = true
@@include_blank_for_select_by_default = true
@@required_string = proc { %{content_tag(:abbr, '*', :title => ::Formtastic::I18n.t(:required))} }
@@required_string = proc { %{<abbr title="#{::Formtastic::I18n.t 'formtastic.required', :default => 'required'}">*</abbr>} }
@@optional_string = ''
@@inline_errors = :sentence
@@label_str_method = :humanize
Expand Down

2 comments on commit 7e99618

@grimen
Copy link
Contributor

@grimen grimen commented on 7e99618 Nov 23, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eugh, this is not valid when I look on it closer. ::Formtastic::I18n != ::I18n

Incorrect:

::Formtastic::I18n.t 'formtastic.required', :default => 'required'

Correct:

::Formtastic::I18n.t(:required)

No matter if I18n is loaded or not. The above change will give incorrect lookup. See Formtastic::I18n module.

@grimen
Copy link
Contributor

@grimen grimen commented on 7e99618 Nov 23, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:default => 'required' will just override the default (no problemo), but why override the default with the default? ;)

Please sign in to comment.