Hi Kostas,

On May 7, 9:52 am, Kostas <[email protected]> wrote:
> However I need to specify the order by which the different locales
> appear when fields_for runs. For example I want the :el locale fields
> to appear before :en (yes, alphabetically, or more generally,  a
> predictable ordering is need).
>
>
[snip]
> ... which of course "works for me" but I have no idea of its side-
> effects and of course I feel less than competent about changing core
> code like this.

I had exactly the same thoughts a couple of weeks ago and I think I
came up with the same solution, although additionally I want to stop
the redundant association call if we are already providing an array to
fields_for, as that is potentially quite expensive. A monkey patch
version of my code (can be placed in config/initializers) is here:
http://gist.github.com/109772

Your patch has the virtue of being a lot simpler and thus less likely
to fail and more likely to be accepted!

Of course the workaround is in the Rails docs, simply loop over your
association outside of field_for, calling it for each object, but this
seems particularly wasteful and inelegant.
Is anyone else interested in this functionality?

All the best,
Andrew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to