scarfacedeb / rails_admin_globalize_field

Tabbed interface and custom field type for globalize translations for Rails_admin
MIT License
50 stars 60 forks source link

Add translation fields as the first item in the edit form #7

Closed fstephany closed 10 years ago

fstephany commented 10 years ago

The translation fields are, by default, displayed at the bottom of all the other fields in the model. How can I change the order?

edit do
  # I wanna add the translations fields here.
  field :reseller_only
  field :families
  field :image
end
fstephany commented 10 years ago

Ok, got it. This is working:

rails_admin do
    navigation_label 'Catalogue'
    weight 0
    nestable_list({
      live_update: :only,
      position_field: :row_order
    })

    configure :translations, :globalize_tabs

    list do
      field :name
      field :reseller_only
      field :created_at do
        date_format :short
      end
      field :updated_at do
        date_format :short
      end
    end

    edit do
      field :translations
      field :reseller_only
      field :families
      field :image
    end
  end