-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
translated_inputs - only last input is rendered #4
Comments
So, you're having inputs for all locales for name field and description input is completely misssing? |
Also, what happens if you add another field to that block? |
I've tested it now with 3 fields in different positions. Every time, only the last field is rendered. |
That's interesting, because if the rendered field is the last one I have an idea of what is happening. It's like when you're using arbre with rails helpers as in li { 3.times { |i| link_to(i, '#') } } # this will show only last link
li { 3.times { |i| text_node link_to(i, '#') } } # this will show all links In original report you're saying that the shown input is the first one and with 3 inputs only last is rendered, is that correct? |
Sorry, I mixed that up in my first report. I've double checked it now: it's always the last input that is shown, so your idea seems to be correct... |
I've updated AA to the latest github version and I'm not able to reproduce your issue. There is a tested resource which should resemble your configuration and with the latest AA and formtastic the issue does not happen. Could you post your AA and formtastic exact versions from Also native gem 'activeadmin-globalize', '~> 1.0.0.pre', github: 'fabn/activeadmin-globalize', branch: 'test-fix' |
I've tried the test-fix branch without success. The issue remains. Gems included by the bundle:
|
I've tried several versions now but also the test-fix branch does not work for me. I tried to set up a complete new project to test it but without success. Everytime, only the last t.input is rendered. For the moment, I ended up doing something like f.input :name_de
f.input :name_en
f.input :description_de
f.input :description_en with the globalize-accessors gem. Do you have any solution yet? |
I wasn't able to reproduce your issue yet. I have a couple of apps running this code and both run fine. Also the embedded test application works. If you have a full project which reproduce the issue please share it on github and I'll try to work on this issue as soon as I have some spare time. A minimal new rails app with the issue would be enough to try to fix this. |
Finally I have a trace now: In a clean new project, when I do something like form do |f|
f.semantic_errors # shows errors on :base
f.inputs 'General' do
f.input :name
end
f.translated_inputs "Details", switch_locale: true do |t|
t.input :description
t.input :interests
t.input :presets
end
f.actions
end there is no problem. But when I reverse the two sections, namely: form do |f|
f.semantic_errors # shows errors on :base
f.translated_inputs "Details", switch_locale: true do |t|
t.input :description
t.input :interests
t.input :presets
end
f.inputs 'General' do
f.input :name
end
f.actions
end the problem described arises. So, only when f.translated_inputs is the first item in the form the issue exists. |
@gerdhuebscher sorry for a such long time to answer. I was finally able to reproduce the issue. The issue happens only when f.inputs 'Details' do
f.translated_inputs "Details", switch_locale: true do |t|
t.input :description
t.input :interests
t.input :presets
end
end P.S. Latest develop is tested now against released activeadmin. I'll try to fix the issue and to clean the api to use it as in your example. |
any progress, @mauriciopasquier :) ? |
Thank you for the new version in the develop branch. I've tested it now and it seems to work except for one issue:
When generating a form like the following:
f.translated_inputs "General", switch_locale: true do |t|
t.input :description
t.input :name
end
Only the first t.input is rendered. The second is ignored.
Could you please have another look into this. Thank you!
The text was updated successfully, but these errors were encountered: