leftis / globalize3_helpers Goto Github PK
View Code? Open in Web Editor NEWglobalize3 batch_translations plugin converted to gem
globalize3 batch_translations plugin converted to gem
Yes I think there is an issue with nested forms - first I was unsure and checked everything but i can't seem to get it to work correctly with nested forms...
view partial, included in main form:
%fieldset.well
%legend= t('views.picture.title')
- f.globalize_fields_for_locales(I18n.available_locales) do |field_builder|
= field_builder.input :text, label: t('views.picture.fields.text'), as: :text, input_html: { :class => 'span4', rows: "4" }
= f.hidden_field :_destroy
.controls
= link_to t('actions.remove'), '#', class: 'remove_fields btn btn-danger'
picture model:
class Picture < ActiveRecord::Base
attr_accessible :image,
:image_cache,
:translations_attributes
belongs_to :property, inverse_of: :layouts
belongs_to :property, inverse_of: :impressions
mount_uploader :image, ImageUploader
translates :text
accepts_nested_attributes_for :translations, allow_destroy: true
end
I'm not quite sure why but it does seem to me the globalize_fields_for_locale method doesn't always set the object id correctly...
But apart from this problem great helpers, thanks a lot!
Enhance the globalize_fields_for_locales with alias_method, supering from globalize_fields_for_locale
Hi, globalize_fields_for_locales
shows the same name in the label and it's impossible to understand which field corresponds to a locale. It could be useful to have a variable inside the helper to show the locale in the label:
<% f.globalize_fields_for_locales [:en, :it] do |g| %>
<%= g.input :name, label: "Name (#{g.active_locale})" %>
<% end %>
I'm using simple_form.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.