class Trestle::Mobility::Fields::TextField

Public Instance Methods

field() click to toggle source
# File lib/trestle/mobility/fields/text_field.rb, line 5
def field
  label = options[:label] || name.to_s.humanize
  locales = options[:locales] || I18n.available_locales.sort
  selected = options[:selected] || Trestle.config.mobility.selected.call || locales.first
  deepl_query_params =  options[:deepl_query_params] || {}

  @template.render partial: "trestle/mobility/text_field",
                   locals: {
                     builder: builder,
                     options: options,
                     field_name: name,
                     label: label,
                     locales: locales,
                     selected: selected,
                     deepl_query_params: deepl_query_params
                   }
end