Closed nonsense closed 11 years ago
Hi, Anton. thanks for the reporting.
I created a test app with roughly the same gems that you used - rails_admin, globalize3, paper_trail.
I noticed that you still use attr_accessible
macros. So, I added protected_attributes
gem as well.
I couldn't reproduce your particular bug, but I noticed this warning in the console output:
WARNING: Can't mass-assign protected attributes for Article::Translation: locale
This warning causes tabs to stay hidden, but I can see them in the page source code.
When I added this code into Article.rb, tabs reappeared:
class Article::Translation
attr_accessible :locale
end
Could you check the page source code to see if tabs content is there, hidden? Also, it would be helpful for me to see this source code, could you provide it to me?
Hi Andrew,
Thanks for the quick response!
After reading your comment, I decided to start from scratch and not to include protected_attributes.
It appears this was part of the issue, but now I have another problem - the fields appear inside Translations, but are also duplicated for the current locale above Translations, which is weird. This is not the case with your screenshots...
The repository is at: http://github.com/nonsense/disaster
Thanks, Anton
I ended up doing:
rails_admin do
edit do
field :user
field :translations
end
end
inside my Article model. Is this how I am supposed to hide the duplicate fields, or I am doing something wrong?
Thanks, Anton
I've probably found the cause of duplicated fields.
You have 2 sets of the same fields: inside the articles table and inside the article_translations table.
(thus, you have 2 migrations 20131017153746_create_articles.rb
and 20131017154123_translates_articles.rb
that create these fields).
Therefore, rails_admin gives you that fields line this:
You don't need to add rails_admin configuration for Article model by default, but usually I just use include_fields
method that helps to reorder the fields as I need it.
Thanks a lot Andrew! That solves it all. I guess these issues were due to me using rails i18n for the first time, and not your gem :) I am marking as resolved now!
No problem!
I am having troubles making the gem work with Rails 4 and RailsAdmin 0.5.0
I have an Article model:
rails_admin.rb initialiser consists of:
Any ideas what could be wrong?