【Ruby】Ruby on Rail ..
[2ch|▼Menu]
620:nobodyさん
09/12/28 01:09:51
>>619

全く未検証ながら、
ActionView::Base::Helpers::ActiveRecordHelper#to_date_select_tag(など)の定義を
app/helpers以下にコピってきて、

error_wrapping(to_date_select_tag_without_error_wrapping(options, html_options),
  object.errors.on(@method_name))
を、
has_error =
case @method_name
when :from_date, :to_date; object.errors.on(:from_date) or object.errors.on(:to_date)
else objet.errors.on(@method_name)
end
error_wrapping(to_date_select_tag_without_error_wrapping(options, html_options), has_error)
と書き換えた定義を作る。

from_date to_dateのフィールドのエラーを判定するときだけ相方のエラーも考慮。



次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5411日前に更新/279 KB
担当:undef