Sha256: b029514730f6a2efa56b4d1e7723896ffbae41265b4f704cba14da3853f92cd5
Contents?: true
Size: 752 Bytes
Versions: 19
Compression:
Stored size: 752 Bytes
Contents
# frozen_string_literal: true module PagesCore module Admin module LocalizedFormBuilder include PagesCore::Admin::LocalesHelper def text_area(method, options = {}) super(method, localized_form_field_options(method).merge(options)) end def text_field(method, options = {}) super(method, localized_form_field_options(method).merge(options)) end private def localized_form_field_options(method) unless object.is_a?(LocalizableModel::InstanceMethods) && object.class.localized_attributes.include?(method.to_sym) return {} end { dir: rtl_locale?(object.locale) ? "rtl" : "ltr", lang: object.locale } end end end end
Version data entries
19 entries across 19 versions & 1 rubygems