Skip to content

Instantly share code, notes, and snippets.

View Slotos's full-sized avatar

Dmytro Soltys Slotos

  • Wrocław, Polska
  • 23:36 (UTC +01:00)
View GitHub Profile
@Slotos
Slotos / aa_globalize_hack.rb
Created March 26, 2012 11:53
ActiveAdmin Globalize form
module Formtastic
class FormBuilder
def globalize_inputs(*args, &proc)
index = options[:child_index] || "#{self.object.class.to_s}-#{self.object.object_id}"
linker = ActiveSupport::SafeBuffer.new
fields = ActiveSupport::SafeBuffer.new
::I18n.available_locales.each do |locale|
linker << self.template.content_tag(:li,
self.template.content_tag(:a,
::I18n.t('translation', :locale => locale),