Skip to content
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" inside "has_many" not working #5

Open
GarPit opened this issue Feb 5, 2015 · 14 comments
Open

"translated_inputs" inside "has_many" not working #5

GarPit opened this issue Feb 5, 2015 · 14 comments

Comments

@GarPit
Copy link

GarPit commented Feb 5, 2015

For example

f.has_many :variants, allow_destroy: true do |var|
    var.translated_inputs "", switch_locale: false do |t|
      t.input :size, hint: 'Weight'
      t.input :price
    end
end
@fabn
Copy link
Owner

fabn commented Feb 5, 2015

What do you get? Nothing at all or just the last field? Did you see discussion in #4? Is this the same issue? Which branch are you on? develop or master

Also please send me the output of bundle show command.

I'll try to dig into this to make gem working with but at the moment is not easy, mainly because of activeadmin/activeadmin#3213

At the moment is nearly impossible to support all commits in activeadmin repository. If they tags some 1.0.0.pre release version I'll try to fix all issues to be compatible with tagged releases.

@GarPit
Copy link
Author

GarPit commented Feb 5, 2015

I've got nothing at all. "develop" branch

@fabn
Copy link
Owner

fabn commented Feb 5, 2015

Ok, please include your current AA commit from bundle show

@GarPit
Copy link
Author

GarPit commented Feb 5, 2015

activeadmin-globalize-fd38348a35aa

@fabn
Copy link
Owner

fabn commented Feb 5, 2015

@GarPit not my gem commit, activeadmin commit (or even better output of bundle show). Thanks.

@GarPit
Copy link
Author

GarPit commented Feb 5, 2015

activeadmin-76f194ebe333

@fabn
Copy link
Owner

fabn commented Feb 5, 2015

Ok, so it's the current master branch. I'll try to see if I can make it working again with master in the next few days, as soon as I have some spare time.

Thanks for reporting.

@micred
Copy link

micred commented Apr 27, 2015

Hi @fabn do you know an activeadmin commit which works with activeadmin-globalize implementation of translated has_many?
I will be happy to rollback activeadmin to solve this issue.
I've test latest develop revision (f5b1602ed4) and 1.0.0.pre1 on RubyGems.

Thank you very much,
Michele

@fabn
Copy link
Owner

fabn commented Apr 27, 2015

@micred my app is using with activeadmin/activeadmin@930d34c with this plugin @0bdb3d2 and it works with no issues. I also need to update my app to a stable version but I haven't found time to fix that.

@zenati
Copy link

zenati commented Jul 28, 2015

Any news on this issue? It doesn't work with develop branch + AA 1.0.
Thanks.

@micred
Copy link

micred commented Sep 29, 2015

Not yet, I added in my Gemfile:
gem 'activeadmin', github: 'activeadmin/activeadmin', ref: '930d34c'

@kjakub
Copy link

kjakub commented Jul 25, 2016

i am trying following(some modifications also ) and no luck - any help here if someone is still alive ?

    f.inputs 'Pictures' do
      f.has_many :pictures, allow_destroy: true do |p|
        p.inputs do
          Globalize.with_locale(:en) do
            p.input :text
          end
          p.translated_inputs '', switch_locale: true, available_locales: (I18n.available_locales - [:en]) do |t|
            t.input :text
          end
        end
        p.input :position
        p.input :picture_file, input_html: { :class => 'autogrow' }, required: false,                               
                               as: :file,
                               hint: p.object.picture_file.file? ? p.template.image_tag(p.object.picture_file.url(:medium), width: 400, height: 225) : p.template.content_tag(:span, 'No Image Yet')
      end
    end

nothing is rendered inside p.inputs do ..block

@halilim
Copy link

halilim commented Jul 27, 2016

@kjakub I'm not sure if this is of any use for you but I use something like this (with custom styling):

f.has_many :options, class: 'hmf-property-option' do |o|
  o.has_many :translations, heading: false do |ot|
    ot.input :locale, as: :hidden
    ot.input :name, label: "#{t('attributes.name')} #{ot.object.locale}"
  end
end

@kjakub
Copy link

kjakub commented Jul 28, 2016

@halilim thanks will try!

wongy91 referenced this issue in coingecko/activeadmin-globalize Oct 10, 2018
tkalliom added a commit to tkalliom/activeadmin-globalize that referenced this issue Apr 25, 2022
The solution should probably also consider has_many, see
fabn#5
tkalliom added a commit to tkalliom/activeadmin-globalize that referenced this issue May 5, 2022
The solution should probably also consider has_many, see
fabn#5
tkalliom added a commit to tkalliom/activeadmin-globalize that referenced this issue May 5, 2022
The solution should probably also consider has_many, see
fabn#5
tkalliom added a commit to tkalliom/activeadmin-globalize that referenced this issue May 5, 2022
The solution should probably also consider has_many, see
fabn#5
tkalliom added a commit to tkalliom/activeadmin-globalize that referenced this issue May 5, 2022
The solution should probably also consider has_many, see
fabn#5
tkalliom added a commit to tkalliom/activeadmin-globalize that referenced this issue May 5, 2022
The solution should probably also consider has_many, see
fabn#5
tkalliom added a commit to tkalliom/activeadmin-globalize that referenced this issue May 16, 2022
The solution should probably also consider has_many, see
fabn#5
tkalliom added a commit to Celkee/activeadmin-globalize-2 that referenced this issue Jun 6, 2022
The solution should probably also consider has_many, see
fabn#5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants