Блок:Rails 4 + Globalize + Activeadmin + activeadmin-глобализацию, activeadmin-переводить не работает
form do |f| | f |
f.translate_inputs of | t |
t.input : title
t.input : text
t.input : locale , as: : hidden
end
f.actions
end
всегда показывает последнее поле, я считаю, что проблема является жемчужиной 'activeadmin -translate' GitHub 'rbatllet/activeadmin -translate'.
ADMIN/post.rb
ActiveAdmin.register Post do # if you are using Rails 4 or Strong
Parameters: permit_params :title, :text, translations_attributes:
[:locale, :title, :text, :id]
index do
# ...
translation_status
# ...
#default_actions end
form do |f|
f.translate_inputs do |t|
t.input :title
t.input :text
t.input :locale, as: :hidden
end
f.actions end end
модели/post.rb
class Post < ActiveRecord::Base
active_admin_translates :title, :text do
#validates_presence_of :title
end
accepts_nested_attributes_for :translations
end
Вы должны органайзера код для стартеров. Например, 'form do | f | | f | 'должен быть таким? – lcguida