Class: Releaf::I18nDatabase::Translations::TableBuilder

Inherits:
Builders::TableBuilder
  • Object
show all
Defined in:
app/builders/releaf/i18n_database/translations/table_builder.rb

Instance Method Summary collapse

Instance Method Details

#cell_content(resource, column, options) ⇒ Object



15
16
17
# File 'app/builders/releaf/i18n_database/translations/table_builder.rb', line 15

def cell_content(resource, column, options)
  tag(:span, super)
end

#cell_format_method(column) ⇒ Object



23
24
25
26
27
28
29
# File 'app/builders/releaf/i18n_database/translations/table_builder.rb', line 23

def cell_format_method(column)
  if Releaf.application.config.all_locales.include? column
    :locale_value
  else
    super
  end
end

#column_namesObject



3
4
5
# File 'app/builders/releaf/i18n_database/translations/table_builder.rb', line 3

def column_names
  [:key] + Releaf.application.config.all_locales
end

#head_cell_content(column) ⇒ Object



7
8
9
10
11
12
13
# File 'app/builders/releaf/i18n_database/translations/table_builder.rb', line 7

def head_cell_content(column)
  if Releaf.application.config.all_locales.include? column.to_s
    translate_locale(column)
  else
    super
  end
end

#locale_value(resource, column) ⇒ Object



19
20
21
# File 'app/builders/releaf/i18n_database/translations/table_builder.rb', line 19

def locale_value(resource, column)
  resource.locale_value(column)
end