Giter VIP home page Giter VIP logo

globalize3_helpers's People

Contributors

alecslupu avatar leftis avatar luisdoubrava avatar rui-castro avatar tommyblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

globalize3_helpers's Issues

Nested forms

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!

Show the locale in the label

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.

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.