Module: Russian::ActionViewExt::Helpers::DateHelperPatch
- Defined in:
- lib/russian/action_view_ext/helpers/date_helper.rb
Overview
Patch for ActionView::Helpers::DateHelper.
Патч для ActionView::Helpers::DateHelper.
Instance Method Summary collapse
-
#select_month(date, options = {}, html_options = {}) ⇒ String
Builds a ‘<select>` with month options and forces standalone month names for Russian.
Instance Method Details
#select_month(date, options = {}, html_options = {}) ⇒ String
Builds a ‘<select>` with month options and forces standalone month names for Russian.
The method keeps standard Rails month helper behavior and options, but injects ‘use_standalone_month_names: true` before delegating to Rails. This makes Russian month names render as standalone forms such as `Декабрь` instead of contextual forms such as `декабря`.
Формирует ‘<select>` со списком месяцев и принудительно использует отдельностоящие названия месяцев для русского языка.
Метод сохраняет стандартное поведение и опции Rails month helper’а, но перед делегированием в Rails добавляет ‘use_standalone_month_names: true`. Благодаря этому для русского языка рендерятся отдельностоящие формы вроде `Декабрь`, а не контекстные формы вроде `декабря`.
103 104 105 |
# File 'lib/russian/action_view_ext/helpers/date_helper.rb', line 103 def select_month(date, = {}, = {}) super(date, .merge(use_standalone_month_names: true), ) end |