Comments (11)
Having this problem and the reason I need it in a form is because I have a ff.inputs in a f.inputs and the second inputs doesnt show up:
f.inputs ... do |ff|
ff.inputs
But in a partial it will show up but duplicates all the fields.
If anyone knows a way around this please let me know.
from activeadmin-globalize.
Hi marcusg, I used this gem heavy and never had this issue. Did you tryed it also the "native" way?
# Just coded in this textbox without any garantee...
ActiveAdmin.register Message do
form do |f|
f.translated_inputs "Translated fields" do |t|
t.input :title
t.input :content
end
f.actions do
f.action(:submit) << f.template.content_tag(:li, class:"cancel") do
link_to I18n.t('active_admin.cancel'), :action => "index"
end
end
end
end
from activeadmin-globalize.
Oh and here is maybe a typo in - f.translated_inputs do |t|
shouldnt it be like this = f.translated_inputs do |t|
?
from activeadmin-globalize.
hey @codingluke: I see the double inputs only when using a partial for the form. When I try the way you suggest, everything works. Also changing - f.translated_inputs do |t|
to = f.translated_inputs do |t|
shows the same behaviour. I think it has to do with the ActiveAdmin::FormBuilder
in some way.
I found the following workaround, but it is ugly.
= semantic_form_for [:admin, @message], :builder => ActiveAdmin::FormBuilder do |f|
- f.translated_inputs do |t|
- t.input :title
- t.input :content
= t.form_buffers.last
= f.actions do
= f.action :submit
%li.cancel
= link_to I18n.t('active_admin.cancel'), {:action => "index"}
Note the = t.form_buffers.last
. Also other users have similar problems (activeadmin/activeadmin#965, activeadmin/activeadmin#1917)
from activeadmin-globalize.
the activeadmin overriding of formtastic formbuilders with all that t.form_buffers.last
crap is terrible and one of the reasons i'm starting to hate activeadmin itself. it's really nonsense and it makes it hard to produce any extension to the default behaviour. i don't have the time to investigate this further now, please let me know if you can produce a patch for this gem (or need some kind of help to make it).
from activeadmin-globalize.
I'm having this is as well in master. Anyone have an update on this?
from activeadmin-globalize.
+1. I'm also having this issue when I pull the form into a partial.
from activeadmin-globalize.
When I have a form partial and a f.has_many
it goes double, but if I take out the has_many
it's fine.
Similarly, When I used the "native" way, it works fine unless I have a f.content
section in the form, at which point it duplicates again.
Very frustrating.
from activeadmin-globalize.
Any update on this ?
from activeadmin-globalize.
I end up just putting everything in a partial:
form partial: 'form'
then used emded ruby following the formtastic syntax
from activeadmin-globalize.
The anwser... activeadmin/activeadmin#5326 (comment)
from activeadmin-globalize.
Related Issues (19)
- Validation errors are not shown HOT 1
- Delete empty translation records on save HOT 5
- css not precompiled on heroku HOT 1
- Unable to use translated_inputs with form partial HOT 2
- Save empty translations HOT 1
- Internationalization for translated fields doesn't work HOT 12
- Set default open tab
- Asset Pipeline ... HOT 4
- Problem with validations declared in active_admin_translates HOT 2
- Version for Rails 3 HOT 2
- Validation: at least a language
- Updating record creates new translation records instead of updating them HOT 3
- After upgraded to AA 1.0.0.pre notebook tabs urls are broken HOT 1
- f.translated_inputs can't be split up across input-groups HOT 1
- Sorting of translated column leads to an exception HOT 1
- activeadmin 9132da6 form_buffer removed HOT 7
- I can't use "translated_inputs" inside "has_many" HOT 3
- Save slug for all availabe locales HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from activeadmin-globalize.