R
R
Roman Mirilaczvili2015-11-01 01:23:46
Ruby on Rails
Roman Mirilaczvili, 2015-11-01 01:23:46

What is the correct way to update data for ActsAsTaggableOn::Tag::Translation in ActiveAdmin?

I'm trying to register the ActsAsTaggableOn::Tag::Translation model to be able to translate tags.
Followed the guide https://github.com/activeadmin/activeadmin/blob/ma... which says

ActiveAdmin.register Post do
  permit_params :title, :content, :publisher_id
end

I have tried several ways and unfortunately none of them allow updating the model data.
First this one:
ActiveAdmin.register ActsAsTaggableOn::Tag::Translation, :as => "TagTranslation" do
  permit_params :name, :tag_id, :locale
end

Then this one:
ActiveAdmin.register ActsAsTaggableOn::Tag::Translation, :as => "TagTranslation" do
  permit_params acts_as_taggable_on_tag_translation: [:name, :tag_id, :locale]
end

And even this one:
ActiveAdmin.register ActsAsTaggableOn::Tag::Translation, :as => "TagTranslation" do
  controller do
    def permit_params
      params.permit! # разрешить любые
#      params.permit acts_as_taggable_on_tag_translation: [:name, :tag_id, :locale]
#      params.require(:acts_as_taggable_on_tag_translation).permit(:name, :tag_id, :locale)
    end
  end
end

What am I missing?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question