Skip to content

jklimke/activeadmin-globalize

 
 

Repository files navigation

ActiveAdmin::Globalize

Makes it easy to translate your resource fields.

Context

The original gem is not maintened anymore, so I forked it to be compatible for Rails 4.2 and globalize 5 .

Installation

gem "activeadmin-globalize", github: 'alexhifer/activeadmin-globalize'

Your model

active_admin_translates :title, :content do
  validates_presence_of :title
end

Editor configuration

# if you are using Rails 4 or Strong Parameters:
permit_params translations_attributes: [
                :id, :locale, :title, :content
              ]

index do
  # ...
  translation_status
  actions
end

form do |f|
  # ...
  f.translated_inputs "Translated fields", switch_locale: false do |t|
    t.input :title
    t.input :content
  end
  # ...
end

If switch_locale is set, each tab will be rendered switching locale.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 82.9%
  • CSS 8.9%
  • CoffeeScript 8.2%