Giter Club home page Giter Club logo

Comments (11)

Babbz75 avatar Babbz75 commented on July 2, 2024 1

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.

codingluke avatar codingluke commented on July 2, 2024

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.

codingluke avatar codingluke commented on July 2, 2024

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.

marcusg avatar marcusg commented on July 2, 2024

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.

stefanoverna avatar stefanoverna commented on July 2, 2024

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.

thegrubbsian avatar thegrubbsian commented on July 2, 2024

I'm having this is as well in master. Anyone have an update on this?

from activeadmin-globalize.

edatrix avatar edatrix commented on July 2, 2024

+1. I'm also having this issue when I pull the form into a partial.

from activeadmin-globalize.

dgm avatar dgm commented on July 2, 2024

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.

kashifnaseer avatar kashifnaseer commented on July 2, 2024

Any update on this ?

from activeadmin-globalize.

Babbz75 avatar Babbz75 commented on July 2, 2024

I end up just putting everything in a partial:

form partial: 'form'

then used emded ruby following the formtastic syntax

from activeadmin-globalize.

tinogomes avatar tinogomes commented on July 2, 2024

The anwser... activeadmin/activeadmin#5326 (comment)

from activeadmin-globalize.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.