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

I can't use "translated_inputs" inside "has_many" #46

Open
sbrocos opened this issue Dec 3, 2014 · 3 comments
Open

I can't use "translated_inputs" inside "has_many" #46

sbrocos opened this issue Dec 3, 2014 · 3 comments

Comments

@sbrocos
Copy link

sbrocos commented Dec 3, 2014

I've next code:

form do |f|
    f.semantic_errors *f.object.errors.keys
    f.inputs 'General' do
      f.input :active, :as => :boolean
      f.translated_inputs "Translated fields", switch_locale: false do |t|
        t.input :title
        t.input :description, :as => :text
      end
      f.has_many :images, display: :panel do |image|
        image.input :asset, :as => :file
        image.translated_inputs "globalize", switch_locale: false, display: :panel do |translate_image|
          translate_image.input :title
        end
      end
    end
    f.actions
  end

But the in the (html) result isn't exist "translate_image.input :title", is empty.

PD: sorry by my english.

@JeansReal
Copy link

+1

@RickMeijer
Copy link

+1.
I know this is old, but this is the firs result in google, and might help the next developer.

Temporary fix I've found was using Arbre to wrap the translated_inputs with an extra li like so:

f.has_many :images, allow_destroy: true, sortable: :position, heading: 'Side blocks' do |cf|
  cf.template.concat(Arbre::Context.new do
    li do
      cf.translated_inputs switch_locale: false, auto_sort: false do |tf|
        tf.input :title
      end
    end
  end.to_s)
end

far from ideal, but it seems to work on our end.

@vmarquesdev
Copy link

+1

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

4 participants