-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
Hello, I use last mongoid + rails 4.2.0,
MODEL:
class Article
include Mongoid::Document
field :title, localize: true
field :content, localize: true
end
CONTROLLER:
params.require(:article).permit(:title, :content)
VIEW: form.html.haml
= f.fields_for :title_translations, :title_translations do |fo|
= fo.text_field :ru, value: fo.object["ru"]
= fo.text_field :en, value: fo.object["en"]
= fo.text_field :de, value: fo.object["de"]
= fo.text_field :ja, value: fo.object["ja"]
This code allows you to record all the localized field after clicking "Submit", but does not show when editing text fields in current values(blank fields).
I beg your help to understand how to get and set localized fields without changing current locale from "form_for" and "form_tag".
Thanx.